https://wiki.zimbra.com/api.php?action=feedcontributions&user=Komiyama&feedformat=atomZimbra :: Tech Center - User contributions [en]2024-03-29T12:50:45ZUser contributionsMediaWiki 1.39.0https://wiki.zimbra.com/index.php?title=Zimlet_Developers_Guide:Internationalization&diff=21287Zimlet Developers Guide:Internationalization2010-10-20T18:40:09Z<p>Komiyama: /* Properties File Naming Convention */</p>
<hr />
<div>{| cellspacing="0" cellpadding="5" style="border: 1px solid rgb(153, 153, 170); margin: 0pt 0.5em 0.5em 0pt; float: none; background-color: rgb(249, 249, 255);"<br />
|[[Image:zdg-6-menu-icon-zimbra.jpg|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Introduction|Introduction]]<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-green-flag.png|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Getting Started|Getting Started]]<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-terminal.png|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Dev Environment Setup|Dev Environment Setup]]<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-gear.png|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Developing Zimlets|Developing Zimlets]]<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-advanced.jpg|20px]]<br />
|<br />
{|<br />
|[[ZCS 6.0:Zimlet Developers Guide:Advanced Concepts|Advanced Concepts]]<br />
|-<br />
|[[ZCS 6.0:Zimlet Developers Guide:Application Context|Application Context]]<br />
|-<br />
|[[ZCS 6.0:Zimlet Developers Guide:Templates|Templates]]<br />
|-<br />
|[[ZCS 6.0:Zimlet Developers Guide:Java and JSP|Java & JSP]]<br />
|-<br />
|[[ZCS 6.0:Zimlet Developers Guide:Portal|Portal]]<br />
|-<br />
|[[ZCS 6.0:Zimlet Developers Guide:Zimlet Tab|Zimlet Tab]]<br />
|-<br />
|'''Internationalization'''<br />
|}<br />
<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-library.jpg|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Zimlet API Specifications|API Specifications]]<br />
|style="border-left: 1px solid rgb(153, 153, 170);"|[[Image:zdg-6-menu-icon-checkbox.jpg|20px]]<br />
|[[ZCS 6.0:Zimlet Developers Guide:Example Zimlets|Example Zimlets]]<br />
|}<br />
<br />
<br />
<br />
{{Article Infobox|{{devel}}|{{ZCS 6.0}}||}}== Internationalization ==<br />
<br />
Internationalization is the process of designing a zimlet so that it can be adapted to various languages and regions without code changes. Sometimes the term internationalization is abbreviated as i18n (because there are 18 letters between the first "i" and the last "n").<br />
<br />
To internationalize your zimlets, you can include <code>.properties</code> files with your zimlet. These files will include the internationalized text resources used in your zimlet. You can include multiple properties files with your zimlet to support multiple locales.<br />
<br />
An example zimlet is provided [[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_i18n_Example|here]].<br />
<br />
Note: A ''locale'' is the combination of a ''language'' code and a ''country'' code. For example, the locale for the English language in the country of US is <code>en_US</code>. Or the locale for the English language in the country of United Kingdom is <code>en_GB</code>. A list of locale country codes are available at http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm<br />
<br />
=== Properties File Naming Convention ===<br />
<br />
The properties file must start with your zimlet name, followed by the locale and the <code>.properties</code> extension. These files must be in the base directory of your zimlet. The default locale for a zimlet is <code>en_US</code> ("English-US"). The base zimlet properties file is assumed to be English-US and does not include a locale in the file name.<br />
<br />
For example, a zimlet named "com_zimbra_helloworld" would have the following properties files to handle English in multiple countries:<br />
<br />
{|cellpadding="5" cellspacing="0" border="1"<br />
|style="background-color:#ffffcc;" |'''File'''<br />
|style="background-color:#ffffcc;" |'''Locale Language'''<br />
|style="background-color:#ffffcc;" |'''Locale Country'''<br />
|style="background-color:#ffffcc;" |'''Description'''<br />
|-<br />
|com_zimbra_helloworld.properties<br />
|English ("en")<br />
|United States ("US")<br />
|The default properties resource bundle for the zimlet in the <code>en_US</code> default locale ("Language: English, Country: US")<br />
|-<br />
|com_zimbra_helloworld_en_GB.properties<br />
|English ("en")<br />
|United Kingdom ("GB")<br />
|The properties resource bundle for the zimlet in the <code>en_GB</code> locale ("Language: English, Country: United Kingdom")<br />
|-<br />
|com_zimbra_helloworld_en_CA.properties<br />
|English ("en")<br />
|Canada ("CA")<br />
|The properties resource bundle for the zimlet in the <code>en_CA</code> locale ("Language: English, Country: Canada")<br />
|}<br />
<br />
=== Properties File Syntax ===<br />
<br />
The resource keys are stored in the properties file in the format <code>key=value</code>. For example, for a resource key named "helloworld":<br />
<pre><br />
helloworld = Hello World!<br />
</pre><br />
<br />
Comments can be included in the properties file by prefacing the line with "#". For example:<br />
<pre><br />
# this is a comment in the props file<br />
helloworld = Hello World!<br />
</pre><br />
<br />
'''Note: key names cannot contain periods (".") or dashes ("-"). Underscore ("_") is allowed. For example, "helloworld" or "hello_world" are valid key names but "hello-world" or "hello.world" are not valid key names.'''<br />
<br />
=== Accessing Resource Properties ===<br />
<br />
The resource keys in your zimlet properties files can be accessed from the Zimlet Definition File XML using the "${msg}" syntax.<br />
<br />
For example, accessing a key named "helloworld" from an XML element:<br />
<pre><br />
<toolTipText>${msg.helloworld}</toolTipText><br />
</pre><br />
<br />
For example, accessing a key named "helloworld" from an XML element attribute:<br />
<pre><br />
<menuItem label= "${msg.helloworld}" id="MY_ITEM_ID" /><br />
</pre><br />
<br />
To access resource keys from your Zimlet Handler Object, use the <code>ZmZimletBase.getMessage()</code> JavaScript method:<br />
<pre><br />
var str = this.getMessage("helloworld");<br />
</pre><br />
<br />
To access resource keys from a Template, use the Zimlet Name and the property in your template file with the <code><$=$></code> syntax:<br />
<pre><br />
<table cellspacing="2" cellpadding="0" border="0"><br />
<tr><br />
<td><br />
<b><$= com_zimbra_myzimlet.myresourcekey $></b><br />
</td><br />
</tr><br />
</table><br />
</pre><br />
<br />
=== Additional Information ===<br />
<br />
<ul><br />
<li>When building your zimlet using the [[ZCS_6.0:Zimlet_Developers_Guide:Dev_Environment_Setup#Zimlet_Development_Directory|Zimlet Development Directory]], you will need to load the Zimbra Web Client in [[#Development Mode|Development Mode]] (i.e. with the <code>?dev=1</code> parameter) in order for the zimlet resource properties to load.</li><br />
<li>Naming your Zimlet Handler Object the same as your Zimlet Name will cause sporadic results. Be sure to name the Handler Object something different than your zimlet name. For example, the Handler Object for a zimlet named "com_zimbra_helloworld" should be "com_zimbra_helloworldHandlerObject". See [[ZCS_6.0:Zimlet_Developers_Guide:Developing_Zimlets#Zimlet_Handler_Object|Zimlet Handler Object]] for more information.</li><br />
<li>See [[ZCS_6.0:Zimlet_Developers_Guide:Examples:Simple_i18n_Example|Simple Internationalization Example]] for a working i18n zimlet example.</li><br />
</ul><br />
<br />
<br />
<br />
{{Article Footer|Zimbra Collaboration Suite 6.0|12/22/2009}}<br />
<br />
<br />
[[Category:Developers]]<br />
[[Category:Zimlets]]<br />
[[Category:ZCS 6.0]]</div>Komiyamahttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_Building_ZimbraSelenium&diff=20582Testing: Selenium: Building ZimbraSelenium2010-08-16T19:39:36Z<p>Komiyama: Added "/..." to the p4 command line and decapitalize the default directory name</p>
<hr />
<div>==General Information==<br />
<br />
See [[Building_Zimbra_using_Perforce]].<br />
<br />
==Downloading the Code==<br />
<br />
===Downloading the Prerequisites===<br />
<br />
The ZimbraSelenium project depends on the following Zimbra projects:<br />
<br />
#ZimbraServer<br />
#ZimbraCommon<br />
#ZimbraIM<br />
#ZimbraWebClient<br />
#ZimbraTagLib<br />
<br />
Download the prerequisites:<br />
<br />
<pre><br />
export P4PORT=codes.zimbra.com:2666<br />
mkdir -p /home/public/p4<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraServer/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraCommon/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraIM/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraWebClient/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraTagLib/...<br />
</pre><br />
<br />
where BRANCH is the release branch to download (e.g. main). All files will be downloaded to /home/public/p4.<br />
<br />
===Downloading ZimbraSelenium===<br />
<br />
Download ZimbraSelenium:<br />
<br />
<pre><br />
export P4PORT=codes.zimbra.com:2666<br />
mkdir -p /home/public/p4<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraSelenium/...<br />
</pre><br />
<br />
where BRANCH is the release branch to download (e.g. main). All files will be downloaded to /home/public/p4.<br />
<br />
==Building ZimbraSelenium using Eclipse==<br />
<br />
===Java===<br />
<br />
ZimbraSelenium requires [http://www.java.com/download/ java 1.6]. Download and install java.<br />
<br />
===Eclipse===<br />
<br />
Download and install [http://www.eclipse.org/downloads/ eclipse IDE].<br />
<br />
===Build the Code===<br />
<br />
Use the following steps to build the code:<br />
<br />
# Create new eclipse workspace<br />
## Open eclipse<br />
## Create new workspace in /home/public/p4/BRANCH , where BRANCH is the release branch.<br />
# Add all projects to eclipse<br />
## Select File->New->Project->Java Project<br />
## For "Project Name", enter ZimbraSelenium<br />
## Complete these steps for ZimbraCommon, ZimbraIM, ZimbraServer, ZimbraTagLib,ZimbraWebClient<br />
# Build ZimbraSelenium<br />
## Expand the ZimbraSelenium project<br />
## Select build.xml, right click, select "Run As"->"Ant Build"<br />
<br />
The output in the console should display:<br />
<br />
<pre><br />
...<br />
[copy] Copying 3 files to C:\home\public\p4\main\ZimbraServer\build\attrs-src<br />
set-buildinfo-vars:<br />
[echo] Version: 6.0.2_BETA1_1111 Date: 20100721-1203<br />
do-generate-ldap-config:<br />
[javac] Compiling 1 source file to C:\home\public\p4\main\ZimbraSelenium\build\classes<br />
jar:<br />
[jar] Building jar: C:\home\public\p4\main\ZimbraSelenium\build\dist\zimbra-6.0.0\lib\zimbraselenium.jar<br />
BUILD SUCCESSFUL<br />
Total time: 19 seconds<br />
</pre><br />
<br />
<br />
<br />
==Troubleshooting==<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Komiyamahttps://wiki.zimbra.com/index.php?title=Testing:_Selenium:_Building_ZimbraSelenium&diff=20581Testing: Selenium: Building ZimbraSelenium2010-08-16T19:20:39Z<p>Komiyama: /* Downloading the Prerequisites */</p>
<hr />
<div>==General Information==<br />
<br />
See [[Building_Zimbra_using_Perforce]].<br />
<br />
==Downloading the Code==<br />
<br />
===Downloading the Prerequisites===<br />
<br />
The ZimbraSelenium project depends on the following Zimbra projects:<br />
<br />
#ZimbraServer<br />
#ZimbraCommon<br />
#ZimbraIM<br />
#ZimbraWebClient<br />
#ZimbraTagLib<br />
<br />
Download the prerequisites:<br />
<br />
<pre><br />
export P4PORT=codes.zimbra.com:2666<br />
mkdir -p /home/public/p4<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraServer/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraCommon/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraIM/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraWebClient/...<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraTagLib/...<br />
</pre><br />
<br />
where BRANCH is the release branch to download (e.g. main). All files will be downloaded to /home/public/p4.<br />
<br />
===Downloading ZimbraSelenium===<br />
<br />
Download ZimbraSelenium:<br />
<br />
<pre><br />
export P4PORT=codes.zimbra.com:2666<br />
mkdir -p /home/public/p4<br />
./p4 -u public -P public1234 -c public-view sync -f //depot/zcs/BRANCH/ZimbraSelenium<br />
</pre><br />
<br />
where BRANCH is the release branch to download (e.g. main). All files will be downloaded to /home/public/P4.<br />
<br />
==Building ZimbraSelenium using Eclipse==<br />
<br />
===Java===<br />
<br />
ZimbraSelenium requires [http://www.java.com/download/ java 1.6]. Download and install java.<br />
<br />
===Eclipse===<br />
<br />
Download and install [http://www.eclipse.org/downloads/ eclipse IDE].<br />
<br />
===Build the Code===<br />
<br />
Use the following steps to build the code:<br />
<br />
# Create new eclipse workspace<br />
## Open eclipse<br />
## Create new workspace in /home/public/p4/BRANCH , where BRANCH is the release branch.<br />
# Add all projects to eclipse<br />
## Select File->New->Project->Java Project<br />
## For "Project Name", enter ZimbraSelenium<br />
## Complete these steps for ZimbraCommon, ZimbraIM, ZimbraServer, ZimbraTagLib,ZimbraWebClient<br />
# Build ZimbraSelenium<br />
## Expand the ZimbraSelenium project<br />
## Select build.xml, right click, select "Run As"->"Ant Build"<br />
<br />
The output in the console should display:<br />
<br />
<pre><br />
...<br />
[copy] Copying 3 files to C:\home\public\p4\main\ZimbraServer\build\attrs-src<br />
set-buildinfo-vars:<br />
[echo] Version: 6.0.2_BETA1_1111 Date: 20100721-1203<br />
do-generate-ldap-config:<br />
[javac] Compiling 1 source file to C:\home\public\p4\main\ZimbraSelenium\build\classes<br />
jar:<br />
[jar] Building jar: C:\home\public\p4\main\ZimbraSelenium\build\dist\zimbra-6.0.0\lib\zimbraselenium.jar<br />
BUILD SUCCESSFUL<br />
Total time: 19 seconds<br />
</pre><br />
<br />
<br />
<br />
==Troubleshooting==<br />
<br />
<br />
<br />
{{Article Footer|unknown|11/7/2007}}<br />
<br />
[[Category: Build]]<br />
[[Category: Testing]]<br />
[[Category: Selenium]]</div>Komiyama