Difference between revisions of "Globalyzer Express"

From Lingoport Wiki
Jump to: navigation, search
(30px Embedded Strings)
Line 62: Line 62:
 
Globalyzer i18n Express scans your committed code, looking for <b>Concatenations</b>, <b>Embedded Strings</b>, <b>Locale-Sensitive Methods</b>, <b>General Patterns</b>, and <b>Static File References</b>.
 
Globalyzer i18n Express scans your committed code, looking for <b>Concatenations</b>, <b>Embedded Strings</b>, <b>Locale-Sensitive Methods</b>, <b>General Patterns</b>, and <b>Static File References</b>.
   
== [[File:gremlinAsset2.png|30px]] Embedded Strings ==
+
== Embedded Strings ==
* <b> Issues</b>: A tongue-in-cheek Gremlin: 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:
+
* <b> Issues</b>: 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 d ="All the young ones";
 
String e ="Having a good time";
 
String e ="Having a good time";

Revision as of 17:30, 4 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 following 15 rule sets.

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 Concatenations, Embedded Strings, Locale-Sensitive Methods, General Patterns, and Static File References.

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