Localizing the My Cloud Services console for version 4.6
You can localize the strings, dates, currency values, and numbers in the My Cloud Services console for languages other than U.S. English. Or you can create your own key/value file as needed.
The locale used in the My Cloud Services console is based on your browser's language setting. Pay attention to the following qualifications:
- If the key/value file is available for your locale, then the text is displayed in that language. Otherwise, the text defaults to U.S. English.
- The currency symbol displayed is whatever the user chooses when the user created the offering. It does not depend on the browser setting.
- The formats of the currency values, numbers, and dates displayed depend on the browser's language setting if the key/value file for the locale is available. Otherwise, they default to U.S. English.
- Date and number searches are localized when you search the Resource List, My Requests, and Activity Log, and when you search on the status column in the Resource List, My Requests, and Activity Log.
- With the exception of the status value, data is not translated by your browser's language setting. Rather, data is displayed in the language in which it was entered.
This topic contains the following information:
- Before you begin
- To localize the key/value files for custom fields in the My Cloud Services console
- To localize the key/value files for strings in the My Cloud Services console
- To localize the key/value files for strings and dates in Monitoring Rules and Performance charts used in the My Cloud Services console
- To localize the key/value files for currency values, numbers, and dates
- To localize the key/value files for searching status column values in the Resource List, My Requests, and Catalog
- To restart Tomcat or Platform Manager
- To view the localized version of the My Cloud Services console
- Related topics
Before you begin
The [confluence_note] macro is a standalone macro and it cannot be used inline. Click on this message for details.
- Verify that your configuration specifies the default location property of the custom directory.
For example: com.bmc.cloud.ui.custom.resource.dir=installDirectory/custom
If the property is missing and not properly configured, you will not see your changes. Add this property with your custom directory as the value if it is missing. Depending on how you installed the My Cloud Services console (clmui), verify that the custom directory is set:- If you installed the My Cloud Services console (clmui) on its own host, open the Config.properties file (by default /opt/bmc/CloudPortalWebApplication/tomcat/webapps/clmui/WEB-INF/classes or C:\Program Files\BMC Software\CloudPortalWebApplication\tomcat\webapps\clmui\WEB-INF\classes).
You should see the following property and value:
com.bmc.cloud.ui.custom.resource.dir=installDirectory\\Cloud_UI\\custom
For example:
com.bmc.cloud.ui.custom.resource.dir=/opt/bmc/CloudPortalWebApplication/Cloud_UI/custom (Linux)
com.bmc.cloud.ui.custom.resource.dir=C:\\Program Files\\BMC Software\\CloudPortalWebApplication\\Cloud_UI\\custom (Windows) If you did not install the My Cloud Services console (clmui) on its own host but on the Platform Manager host, open the cloudservices.json file (by default C:\Program Files\BMC Software\BMCCloudLifeCycleManagement\Platform_Manager\configuration\cloudservices.json).
In the CustomDir section, you should see the attributeValue property whose value is the custom directory:{
"cloudClass" : "com.bmc.cloud.model.beans.AccessAttribute",
"datatype" : "String",
"description" : "Directory that contains customization web content",
"guid" : "780a47aa-d6a9-4894-9aa5-a5fa2ce26cb1",
"hasValueObject" :
[
{
"cloudClass" : "com.bmc.cloud.model.beans.AccessAttributeValue",
"attributeValue" : "C:\\Program Files\\BMC Software\\BMCCloudLifeCycleManagement\\Cloud_UI\\custom",
"guid" : "8b03984d-7750-4ba2-a8f7-8f7ef48fb43d",
"name" : "CustomDir"
}
],
"isOptional" : true,
"isPassword" : false,
"modifiableWithoutRestart" : false,
"name" : "CustomDir"
}
- If you installed the My Cloud Services console (clmui) on its own host, open the Config.properties file (by default /opt/bmc/CloudPortalWebApplication/tomcat/webapps/clmui/WEB-INF/classes or C:\Program Files\BMC Software\CloudPortalWebApplication\tomcat\webapps\clmui\WEB-INF\classes).
- Copy the contents of the installDirectory\Cloud_UI\custom_sample directory to the installDirectory\Cloud_UI\custom directory on the My Cloud Services Console host.
- When you add resource or angular files for your locale, make sure that the encoding in your editor is set to Unicode (UTF-8). Otherwise, your text might be corrupted.
To localize the key/value files for custom fields in the My Cloud Services console
The following instructions describe how to localize the custom fields used inside the Cart Checkout page of the My Cloud Services console. In these steps, you are also creating a localized resource file (for example, resources-locale_fr.js) that eventually will contain all keys/values used in the My Cloud Services console (except for Monitoring Rules and Performance charts).
For more information on custom fields, see Customizing-the-Cart-Checkout-page.
- Locate the resources-locale_en.js file used with the custom fields (by default, located at installDirectory\Cloud_UI\custom\i18n).
Make two copies of the resource files in the i18n directory and save them in the same i18n directory.
You need two files – one without the country code – so that your language works on all supported browsers.- For a complete list of two-digit language codes, see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.
- For a complete list of two-digit country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.
- Rename the copied files with the following formats:
- resources-locale_fr.js
- resources-locale_fr-fr.js
Edit the files and translate all strings in the "value": " " fields.
For example:[
{
"key": "customfields.label.chargecode",
"value": "Code de Charge"
},
{
"key": "customfields.label.decommissiondate",
"value": "Date de Déclassement"
},
]- Save your changes and re-load the Cart Checkout page.
You do not need to restart Tomcat to see these changes to the Cart Checkout page. Your changes are automatically deployed to the Tomcat web application.
To localize the key/value files for strings in the My Cloud Services console
In these steps, you are using the resource file you just created to compile a master resource file that contains all key/values used in the My Cloud Services console except for Monitoring Rules and Performance charts.
- Locate the clmui.war file.
- If you installed the My Cloud Services console on its own host, the clmui.war file is located by default at C:\Program Files\BMC Software\CloudPortalWebApplication\tomcat\webapps on the My Cloud Services console,
- If you installed the My Cloud Services console on the Platform Manager host, the clmui.war file is located by default at C:\Program Files\BMC Software\BMCCloudLifeCycleManagement\Platform_Manager\lib on the Platform Manager
- Navigate to \common\i18n\scripts\ inside the clmui.war file and locate the resources-locale_en.js file.
- Copy the keys and values from the resources-locale_en.js file and paste them into the new resource files you created earlier in To localize the key/value files for custom fields in the My Cloud Services console.
Edit the files and translate all of the strings in the "value": " " fields.
For example:{
"key": "object.type.server",
"value": "Serveur"
},
{
"key": "object.type.database",
"value": "Base de Données"
},
{
"key": "object.type.storage",
"value": "Stockage"
},
{
"key": "grid.columnlabel.projectname",
"value": "NOM DU PROJET"
},- Save the resource files.
You have now combined the keys/values for the custom fields with the keys/values for the rest of the application (except Monitoring Rules and Performance Charts) into a single file for each of the locales that you are adding.
To localize the key/value files for strings and dates in Monitoring Rules and Performance charts used in the My Cloud Services console
You localize the key/value .properties files for Monitoring Rules and Performance charts in a different location from the main My Cloud Services console because it is legacy code based upon jQuery instead of AngularJS. Add strings to the following .properties files:
- LinechartLocal_
- PolicyStrings_
For each .properties file, edit or create the appropriate file for the language you are going to support. The file for your language might already exist, but the strings are in English. If the file exists, simply edit the file and change the strings to your language.
- Locate the resource files extracted from the clmui.war file.
- If you installed the My Cloud Services console on its own host, the TomcatInstallDirectory\webapps\clmui\custom\i18n\bundle directory contains the key/value .properties files extracted from the clmui.war file.
- If you installed the My Cloud Services console on the Platform Manager host, the installDirectory\lib\clmui\custom\i18n\bundle directory contains the key/value .properties files extracted from the clmui.war file. In a Compact Deployment, these files are located at C:\Program Files\BMC Software\BMCCloudLifeCycleManagement\Cloud_UI\custom\i18n\bundle.
- Copy the .properties files files that you intend to support and paste them into the installDirectory\Cloud_UI\custom\i18n\bundle directory.
For example, to add French, add the following files and specify the French translation for each key in the files:- LinechartLocal_fr.properties
- LinechartLocal_fr-fr.properties
- PolicyStrings_fr.properties
- PolicyStrings_fr-fr.properties
To localize the key/value files for currency values, numbers, and dates
For currency values, numbers, and dates, the following key/value files are already available and localized within the third-party AngularJS angular-i18n library:
- U.S. English
- Great Britain English
- Australian English
- New Zealand English
- Indian English
- French
- German
- Swiss German
- Italian
- Spain Spanish
- Mexican Spanish
- Argentinian Spanish
- Danish
- Dutch
- Norwegian
- Portuguese
- Brazilian Portuguese
- Finnish
- Greek
- Russian
- Chinese
- Japanese
- Korean
- Hindi
- Arabic
Only use these steps to create new currency values and number key/value files for languages that are not currently available.
- Locate the resource files extracted from the clmui.war file.
- If you installed the My Cloud Services console on its own host, the TomcatInstallDirectory\webapps\clmui\thirdparty\scripts\angular-plugins\angular-i18n directory contains the angular-locale_<language code>.js files files extracted from the clmui.war file.
- If you installed the My Cloud Services console on the Platform Manager host, the installDirectory\lib\clmui\thirdparty\scripts\angular-plugins\angular-i18n directory contains the angular-locale_<language code>.js files files extracted from the clmui.war file.
- To add support for any other language:
- Create angular-i18n directory at installDirectory\Cloud_UI\custom\i18n\.
- Make a copy of angular-locale_en.js.
- Save it in the installDirectory\Cloud_UI\custom\i18n\angular-i18n directory with the following format:
angular-locale_languageCode-countryCode.js
angular-locale_hu.js (for Hungarian) - Edit your new file and update the values for each key appropriately.
- (optional) Go to https://github.com/angular/bower-angular-i18n to find the file for the locale you are using.
If you use one of these files, you must add the following keys and their values to the angular-locale_hu.js file after shortTime:- customDate
- clmGridDateFormat
- clmGridDateTimeFormat
clmRequestsDateTimeFormat
For example (with line breaks inserted to make the contents easier to read):'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"de.",
"du."
],
"DAY": [
"vas\u00e1rnap",
"h\u00e9tf\u0151",
"kedd",
"szerda",
"cs\u00fct\u00f6rt\u00f6k",
"p\u00e9ntek",
"szombat"
],
"ERANAMES": [
"id\u0151sz\u00e1m\u00edt\u00e1sunk el\u0151tt",
"id\u0151sz\u00e1m\u00edt\u00e1sunk szerint"
],
"ERAS": [
"i. e.",
"i. sz."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"janu\u00e1r",
"febru\u00e1r",
"m\u00e1rcius",
"\u00e1prilis",
"m\u00e1jus",
"j\u00fanius",
"j\u00falius",
"augusztus",
"szeptember",
"okt\u00f3ber",
"november",
"december"
],
"SHORTDAY": [
"V",
"H",
"K",
"Sze",
"Cs",
"P",
"Szo"
],
"SHORTMONTH": [
"jan.",
"febr.",
"m\u00e1rc.",
"\u00e1pr.",
"m\u00e1j.",
"j\u00fan.",
"j\u00fal.",
"aug.",
"szept.",
"okt.",
"nov.",
"dec."
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "y. MMMM d., EEEE",
"longDate": "y. MMMM d.",
"medium": "y. MMM d. H:mm:ss",
"mediumDate": "y. MMM d.",
"mediumTime": "H:mm:ss",
"short": "y. MM. dd. H:mm",
"shortDate": "y. MM. dd.",
"shortTime": "H:mm",
"customDate": "yyyy.MM.dd",
"clmGridDateFormat": "yyyy.MM.dd",
"clmGridDateTimeFormat": "yyyy.MM.dd H:mm",
"clmRequestsDateTimeFormat": "yyyy.MM.dd H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Ft",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "hu",
"pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
These changes modify the date displayed in the My Cloud Services console:
To localize the key/value files for searching status column values in the Resource List, My Requests, and Catalog
The status values displayed in the Resource List, My Requests, and Catalog are localized by the key/value files in the installDirectory\Cloud_UI\custom\i18n directory (that you had already set up). However, those values are searched based upon the localized key/value loc_<language_code>.txt files in the PMInstallDirectory\configuration\localization directory on the Platform Manager.
- On the Platform Manager, navigate to the PMInstallDirectory\configuration\localization directory.
For example, C:\Program Files\BMC Software\BMCCloudLifeCycleManagement\Platform_Manager\configuration\localization. - Open the loc_en.txt file.
Only the U.S. English file is currently available. - Make new copies of the loc_en.txt file and rename them appropriately, for example, loc_fr.txt and loc_fr-fr.txt.
You need both copies (loc_<language_code>.txt and loc_<language_code>-<country_code>.txt) because browsers do not handle locales in which the language and the country are identical (for example, French) in the same way. Edit your new file and update the values for each key appropriately.
For example:# server state, ServiceRequestState, ActivityState, CartState, AuditStatus
Provisionnement => Provisionnement
Installé => Arrêtée- Restart the Platform Manager after you finish all the localization steps, as described in To restart Tomcat or Platform Manager.
To restart Tomcat or Platform Manager
- If you installed the My Cloud Services console (clmui) on its own host and you modified the config.properties file, restart the Tomcat server.
- If you modified cloudservices.json or if you added another loc_<language code>.txt file for searching status column values, restart Platform Manager.
- If you added another locale to use with the My Cloud Services console:
- Add the same locale to the Platform Manager host.
Otherwise, your status-based search will not return the expected results. - Restart the Platform Manager.
- Add the same locale to the Platform Manager host.
To view the localized version of the My Cloud Services console
Perform these final steps after you create new resource and angular files to test if your localization was successful.
- Set the default locale in your browser to match the resource files that you just created, for example, French.
- Clear your browser cache.
- Log on to the My Cloud Services console to see your localized page, for example, French.
Related topics
Localizing the new CLM UI (in BMC Communities)