Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default language #141

Closed
maxlife70 opened this issue Apr 11, 2015 · 9 comments
Closed

default language #141

maxlife70 opened this issue Apr 11, 2015 · 9 comments
Labels

Comments

@maxlife70
Copy link

Hi,
I would like to know if is possible change the default language.to another insteed english.
Thanks

@vitalidze
Copy link
Owner

Yeah, it is possible. The easiest way is to add following line to the traccar.html file packaged inside traccar-web.war inside <head> tag:

 <meta name="gwt:property" content="locale=your_locale_code">

For example for russian locale:

 <meta name="gwt:property" content="locale=ru">

I have a shell script that automates it:

#!/bin/bash

LOCALES=ru
for loc in $LOCALES
do
        cp -f $1 ${loc}_$1
        unzip -p $1 traccar.html | awk -v langtag="    <meta name=\"gwt:property\" content=\"locale=$loc\">" '{print} NR==4{print langtag}' > traccar.html
        jar uf ${loc}_$1 traccar.html
        rm traccar.html
done

To use it I do the following:

./addlocale.sh traccar-web.war

As an output there will be a locale_code_traccar-web.war file (ru_traccar-web.war in above case).

@vitalidze
Copy link
Owner

FYI I have somewhere in my TODO list to add locale and timezone selection to the user's preferences (and maybe to application's preferences too). This will help for example to send localized notifications with date/time in user's timezone.

@maxlife70
Copy link
Author

Great is ok. Thanks.
For mobile version i have changed the lang parameter in the tag HEAD in the index.html file, but the default language is always english. There is other file to change?

PS. I have sent to you by email the new files for italian language. Desktop and mobile version.

@vitalidze
Copy link
Owner

Yeah, above instructions are for desktop version only. For mobile you should update this line https://github.com/vitalidze/traccar-web/blob/dev/src/main/webapp/m/js/traccar-mobile.js#L9 and this line https://github.com/vitalidze/traccar-web/blob/dev/src/main/webapp/m/js/traccar-mobile.js#L100 (i.e. change 'en' to your locale).

PS. Thanks for the translation. I will try to do my best to release it either today or tomorrow.

@maxlife70
Copy link
Author

Ok also the mobile version. Thanks

@vitalidze
Copy link
Owner

FYI I have already finished language selection in 'Global' settings (in scope of 2 from #148). Thus, in newer version you won't need to change anything except that setting. Next version should come next week.

vitalidze added a commit that referenced this issue Apr 20, 2015
@vitalidze
Copy link
Owner

Implemented, written news, updated latest and demo versions.

@maxlife70
Copy link
Author

Hi. With the last release (2.12) i'm no longer able to change default language for desktop versione as you have said to me previously with the meta tag. Mobile is ok.
there is other file to change?
Thanks

@maxlife70
Copy link
Author

I have seen now the new option in global setting. Now is ok.
Sorry for the new question. I close the thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants