dellermann / i18n-asset-pipeline

An asset-pipeline plugin for client-side i18n.
Apache License 2.0
3 stars 8 forks source link

UTF-8 encoding not working in WAR #12

Open mugren opened 8 years ago

mugren commented 8 years ago

Hi,

The i18n files that have translations which need utf-8 encoding are not appropriately encoded when they are compiled for war, however that's not case in dev mode.

I suspect that the problem emerges when the messages are loaded in the I18nProcessor with the resource locator.

This is what I get

(function (win) { var messages = { "passwords.not.equal": "Лозинките не се совпаѓаат", "passwords.equal": "Лозинките се совпаѓаат", "popup.add": "Додади", "popup.update": "Ажурирај", "popup.cancel": "Откажи", "popup.alert.title": "Дали сте сигурни?", "popup.alert.message": "Промените во формата не се сочувани!", "alert.title": "Предупредување", "alert.message": "Пополнете ги задолжителните полиња!", "alert.error.title": "Настана грешка", "alert.error.message": "\"Нешто тргна наопаку...\"", "alert.ok": "Потврди", "alert.cancel": "Откажи", "activity.activity.label": "Активност", "activity.alertWarning.label": "Предупредување за активност", "activity.alertContinues.label": "продолжува...", "activity.alertStatus.label": "Статус", "default.popupAttention.label": "Внимание", "default.popupButtonOk.label": "Добро", "language.label": "mk", "calendar.month.jan.label": "Јан", "calendar.month.feb.label": "Феб", "calendar.month.mar.label": "Мар", "calendar.month.apr.label": "Апр", "calendar.month.may.label": "Мај", "calendar.month.jun.label": "Јун", "calendar.month.jul.label": "Јул", "calendar.month.aug.label": "Авг", "calendar.month.sep.label": "Сеп", "calendar.month.oct.label": "Окт", "calendar.month.nov.label": "Ное", "calendar.month.dec.label": "Дек", "calendar.month.jan.full.label": "Јануари", "calendar.month.feb.full.label": "Февруари", "calendar.month.mar.full.label": "Март", "calendar.month.apr.full.label": "Април", "calendar.month.may.full.label": "Мај", "calendar.month.jun.full.label": "Јуни", "calendar.month.jul.full.label": "Јули", "calendar.month.aug.full.label": "Август", "calendar.month.sep.full.label": "Септември", "calendar.month.oct.full.label": "Октомври", "calendar.month.nov.full.label": "Ноември", "calendar.month.dec.full.label": "Декември", "calendar.day.mo.label": "Пон", "calendar.day.tu.label": "Вто", "calendar.day.we.label": "Сре", "calendar.day.th.label": "Чет", "calendar.day.fr.label": "Пет", "calendar.day.sa.label": "Саб", "calendar.day.su.label": "Нед" }

win.$L = function (code) {
    return messages[code];
}

}(this));

warnerandy commented 6 years ago

i'm currently running into this issue as well, are there any plans on fixing it?

mugren commented 6 years ago

I've opened PR long time ago about this issue https://github.com/dellermann/i18n-asset-pipeline/pull/14