문제

I am looking for a general mechanism to internationalize web application that have to work in offline mode.

Initially I was considering adding data-i18n tags to elements but this seems like a very ugly solution.

I came across http://panacodalabs.github.com/The-M-Docs/#components_&_utilities/m_i18n however I do not wish (or can due to time constrains) port my application to that framework.

I need a HTML5 jQuery Mobile friendly solution to this issue, that works in offline mode.

It seems to me that this crucial component is missing on the HTML5 framework.

도움이 되었습니까?

해결책

I wouldn't necessarily say this is a feature JQM should provide, because this is probably done best with some server side logic.

there would be two ways I can think of doing this:
1. have all your language translations in some standalone js files, which you would have to include in manifest file. check the datebox plugin to see how this could be done ( top right - options).
2. create a local database and store translations in the required languages there.

i think the first one should be easier to handle, but probably harder to setup/maintain. also, depending on the amount of translations, js files do become large...

다른 팁

Have you looked at the jQuery i18n plugin?

http://recursive-design.com/projects/jquery-i18n/

I'm currently using it with jQuery 1.7.1 and jQuery Mobile 1.1.0, and it works perfectly.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top