Fórum

AUI Javascript Localization

thumbnail
Dave Weitzel, modificado 12 Anos atrás.

AUI Javascript Localization

Regular Member Postagens: 208 Data de Entrada: 18/11/09 Postagens Recentes
Some of the AUI javascripts (pagination for example) have English text in them - "Total", "of" , "pages" etc

How can I dynamically change these according to the locale of the page?

Quite happy to be changing both the js file and where it is called whenever I find it our UI hook a=has many files in it already. emoticon
thumbnail
André Bunse, modificado 12 Anos atrás.

RE: AUI Javascript Localization

Junior Member Postagens: 85 Data de Entrada: 16/03/12 Postagens Recentes
Something like this, only a little change

File: %TOMCAT_HOME%/webapps/ROOT/html/js/aui/aui-paginator/aui-paginator.js

			totalLabel: {
				getter: function() {
					var instance = this;
					
					return L.sub(TOTAL_LABEL_TPL, {
						total: instance.get(TOTAL)
					});
				},
				validator: isString
			},

change to

              var translated_label = Liferay.Language.get([u][i]"totalLabel"[/i][/u]);
              return L.sub(TOTAL_LABEL_TPL.replace("Total", translated_label), {

and create the wanted translations under server:8080/language/xx_XX/

hope that points you in the right direction, too late for a further look ;)

André