Difference between revisions of "Globalyzer i18n Express"

From Lingoport Wiki
Jump to: navigation, search
Line 109: Line 109:
 
placemarkAttributes.imageSource = "./img/marker.png";
 
placemarkAttributes.imageSource = "./img/marker.png";
 
* <b>Remedy</b>: The locale framework needs to provide for an internationalization way to refer to the file so that a locale with a static file name will result in serving a Russian video to the Russian user.
 
* <b>Remedy</b>: The locale framework needs to provide for an internationalization way to refer to the file so that a locale with a static file name will result in serving a Russian video to the Russian user.
  +
  +
=Getting Started=
  +
  +
=Scanning and Reviewing Code=

Revision as of 20:36, 8 May 2020

Overview

Globalyzer i18n Express scans the added and modified files checked in on a GitHub commit, looking for i18n issues.

The committed files are scanned with the 15 rule sets listed below.

If there are files checked in with the extensions below, they will be scanned and a summary will be added as a comment to the commit in GitHub. If no files are scanned, for example, you checked in a .txt file, a summary will not be added as a comment to the commit in GitHub.

Globalyzer Rule Sets and Source Files Scanned

Rule Set Language Source File Extensions Scanned
actionscript as, mxml
c++ c, cc, cpp, cxx, h, hpp, hxx, qml
csharp asax, ascx, ashx, aspx, cs, cshtml
delphi dfm, dpk, dpr, pas
html asa, asax, ascx, ashx, asmx, asp, aspx, axd, cshtml, ejs, htm, html, inc, jsp, jspf, jspx, mas, master, mi, php, shtml, skin, svg, tag, vm, xhtml
java java, jsp, jspf, jspx
javascript as, asax, ascx, asp, aspx, cshtml, ejs, htm, html, js, jsp, jspf, jspx, mas, mi, php, xhtml
mysql sqc, sql, sqx
objectivec h, m, mm
perl max, mi, perl, pl, plx, pm
php inc, php
swift2 swift
vbnet ascx, asp, aspx, bas, cls, ctl, dob, dsr, frm, pag, vb
vbscript asax, ascx, asp, aspx, htm, html, vbs, xhtml
xml jspx, mxml, storyboard, tld, vcxproj, wsdd, wsdl, xaml, xhtml, xib, xlf, xml, xsd, xsl, xslt, xul

Globalyzer Scanning Categories

Globalyzer i18n Express scans your committed code, looking for Embedded Strings, Concatenations, Locale-Sensitive Methods, General Patterns, and Static File References.

Each issue found has an assigned priority. The priority ranges between 1 and 5, 1 being the highest - i.e. the most likely to be an internationalization issue. In addition, issues can be marked as 'Concatenated', or priority 0.

Globalyzer i18n Express only reports the top issues found: those with priority 1 or with priority C (concatenated). Please contact info@lingoport.com if interested in our full scanning capabilities.

Embedded Strings

  • Issues: When you change locale, the string stays the same. The string was hard-coded in the application and is resistant to locale changes.For example if there was simple code that looks like:
 String d ="All the young ones";
 String e ="Having a good time";
  • Remedy: Externalize the Embedded String from the source code. Generate a Key/Value pair in a resource file, refer to that key in the code to retrieve the value. The value is the string itself. With your locale framework, you can then retrieve the string from a locale dependent resource file.

When the string is externalized, the code looks like:

 String d =getString("JAVA_TESTSTR_105");
 String e =getString("JAVA_TESTSTR_106");

And the key/value pair in the resource file looks like:

JAVA_TESTSTR_105=All the young ones
JAVA_TESTSTR_106=Having a good time

Concatenations

  • Issues: It's like an Embedded String which cannot be externalized as such. It first needs some redesign. This one comes in all kinds of shapes and sizes. Here is a concatenation example: "Welcome " + username + " to our Rebel Outfitter store"
  • Remedy: The typical remedy is to create a parameterized strings and keep the parameter variables outside of the string itself. For instance, the parameterized string may look like "Welcome %{userName} to our Rebel Outfitter store".

Locale Sensitive Method

Date/Time Format

  • Issues: The application may look right but provides the wrong information. If the date shown is 05/06/07 independently of the locale, it means:
    • May 6, 2007 for an American
    • June 5, 2007 for a Frenchman
    • 2005, June 7 for a Japanese
  • Remedy: The application needs to format the data based on the user's locale and, for instance, show May 6, 2007 as
    • 05/06/07 to an American user
    • 06/05/07 to a French user
    • 07/06/05 to a Japanese user

In addition, the date/time may be displayed using Time Zone. The entity or value itself may need to be a GMT date / time.

Currency Format

  • Issues: The application displays the same amount whatever the locale/region of the user. For instance, a Canadian user sees $5000 and may think that in Canadian dollars when it's in US Dollars.
  • Remedy: The application needs to format the number, display the symbol, and most likely use some exchange rate to display the actual currency amount for the user's language / region.

General Patterns

  • Issues: This may take the form of a encoding like ISO8859-1 when UTF-8 is required, or set a font that cannot be used in Chinese, even decides a format output.
  • Remedy: Make sure to check for each pattern to decide if it is a General Pattern, if more need to be added to your specific application, and how to refactor the code.

Static Files

  • Issues: The application serves the same file, maybe a video or a legal HTML file, independently of the locale. For example, a Chinese video is shown to a Russian application user. For example:
   placemarkAttributes.imageSource = "./img/marker.png";
  • Remedy: The locale framework needs to provide for an internationalization way to refer to the file so that a locale with a static file name will result in serving a Russian video to the Russian user.

Getting Started

Scanning and Reviewing Code