Localization

Localization

Localization is done with the help of resx files under globalization. Localization of interfaces and reports can be made here by using a new resx or existing resx.

Translations in different languages can be added for existing resxes. When a translation in any language is added, it will be displayed on the interfaces.



The syntax [$ resx: key] can be used to use the key in a resx in the interfaces. resx must be replaced with the name of the resx file without specifying a language and extension and key must be replaced with data name inside resx.



<div> <label>[$default:displayname]</label> </div>

You can also use the [.language: ....; language2: ...; language3: ...] format.

<div> <label>[.tr:Adı;en:Name;fr:Nom]</label> </div>

The expression from Resx may not be suitable for use on script or HTML attributes. In this case,  encode operation can be applied using /html or /js parameters.



<button title="[$default:close/html]" onclicke=closeNow()>X</button> <script> function closeNow() { alert("[$MyResx:CloseMessage/js]") //.. } </script>

 Localization can be done with the macro structure.

  • With the context.Localize method you can make translation for a defined language or for the active language.

    • [=c.Localize("[$default:close]")]

    • [=c.Localize("[$default:close]",en-US)]

  • With the context.ToString method, an object can be formatted based on a language.

    • [=c.ToString(DateTime.Now,"en-US","dd MMM yyyy")]

    • [=c.ToString(DateTime.Now,"tr-TR","dd MMM yyyy")]

    •  [=c.ToString(DateTime.Now,null,"dd MMM yyyy")]