Difference between revisions of "Gremlins"

From Lingoport Wiki
Jump to: navigation, search
(30px Concatenations)
Line 12: Line 12:
  
 
= [[File:gremlinAsset1.png|30px]] Concatenations =
 
= [[File:gremlinAsset1.png|30px]] Concatenations =
* <b> Issues</b>: A mean Gremlin: 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".
+
* <b> Issues</b>: A mean Gremlin: 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:<code> "Welcome " + username + " to our Rebel Outfitter store"</code>
* <b>Remedy</b>: 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".
+
* <b>Remedy</b>: 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 <code>"Welcome %{userName} to our Rebel Outfitter store"</code>.
  
 
= [[File:gremlinAsset3.png|30px]] Concatenations =
 
= [[File:gremlinAsset3.png|30px]] Concatenations =
 
* <b> Issues</b>: A mean Gremlin: 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".
 
* <b> Issues</b>: A mean Gremlin: 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".
 
* <b>Remedy</b>: 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".
 
* <b>Remedy</b>: 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".

Revision as of 12:02, 23 July 2019

I18n Gremlins are sneaky issues that work their way into your code and foul up localization. They can be hard for developers to recognize.

I18n Gremlins

Those gremlins sneak up in your source code.

King-gremlin.png No Locale Framework

  • Issues: The king of all Gremlins: If the application does not have a locale framework, the Gremlin King rules and all Gremlins infest the application.
  • Remedy: Design a Locale Framework. How to detect, negotiate, persist, assign the locale for the application needs to be designed and implemented.

GremlinAsset2.png Embedded Strings

  • Issues: A visible Gremlin: When you change locale, the string stays the same. The string was hard-coded in the application and is resistant to locale changes.
  • 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.

GremlinAsset1.png Concatenations

  • Issues: A mean Gremlin: 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".

GremlinAsset3.png Concatenations

  • Issues: A mean Gremlin: 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".