留言板

Translate User Titles (Listtype and Countries) with Dynamic Select

thumbnail
Sergio Cabrera,修改在12 年前。

Translate User Titles (Listtype and Countries) with Dynamic Select

Junior Member 帖子: 68 加入日期: 11-12-19 最近的帖子
Hello, there's another solved thread related to this, but I'd like to reopen it with one question. I have a Combo Box with countries and I fill it with liferay-dynamic-select. My problem is that it's not translated. I've been diving in the code and it's due to the dynamic_select.js:

				A.each(
					list,
					function(item, index, collection) {
						var key = item[selectId];
						var value = item[selectDesc];

						selectOptions.push('<option value="' + key + '">' + value +'</option>');
					}
				);


As you can see the 'value' is written directly. My first attempt has been including 'Liferay.Language.get(value)' instead of 'value', but it's quite slow (several seconds). Is there any other solution for the javascript? Getting the list in the jsp works fine, but I'd like to know if there is another solution using the dynamic select.

Thanks