From 0f49819f17fa642e3752513418d79f4ad70afde3 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Sat, 13 Aug 2016 15:22:09 +0300 Subject: [PATCH] Add doc/TRANSLATING.md - documentation for making translations --- doc/TRANSLATING.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 doc/TRANSLATING.md diff --git a/doc/TRANSLATING.md b/doc/TRANSLATING.md new file mode 100644 index 0000000..393b84a --- /dev/null +++ b/doc/TRANSLATING.md @@ -0,0 +1,75 @@ + +Translating aprsc status view to other languages +=================================================== + +Create a new language file +---------------------------- + +Go to /opt/aprsc/web, and make a copy of the master English strings +file: + + cd /opt/aprsc/web + cp strings-en.json strings-sv.json + +Edit strings-sv.json with your favourite editor, translate all +the strings. Make sure you use UTF-8 encoding in your editor +and terminal. + + +Reconfigure or restart aprsc +------------------------------- + +The aprsc process will scan for string files at startup and when +reloading configuration. This step will only need to be done once +after creating the new string file - after further edits of strings, +simply reload the status web page. + +To reload configuration, execute the `reload` option of the startup script. + +On Ubuntu or Debian: + + sudo service aprsc reload + +On Centos (and others): + + sudo /etc/init.d/aprsc reload + + +Add new language mapping +--------------------------- + +Edit /opt/aprsc/web/aprsc.js - in the beginning you'll find two +statements which need to be adjusted: + + // add additional language codes here, in the end of the list: + var lang_list = ['en', 'fi']; + // and, if necessary, add one new line in the beginning here, + // for dialect mapping (en_US, en_GB to en): + var lang_map = { + 'en_*': 'en', + 'fi_*': 'fi', + '*': 'en' // DO NOT remove or change the default mapping to 'en' + }; + +For Swedish translation, the first list would become: + + var lang_list = ['en', 'fi', 'sv']; + +If Swedish would have dialects ('sv_FI' for Swedish spoken in Finland) +then the mapping for the variants can be added. Otherwise, only clients +requesting plain 'sv' for language will get the translation. + + var lang_map = { + 'en_*': 'en', + 'fi_*': 'fi', + 'sv_*': 'sv', + '*': 'en' + }; + +Pass new translation to upstream aprsc code +---------------------------------------------- + +Give your new translation back to the aprsc project, so that it will be +included in future versions automatically, and that it'll be installed +on other servers too. +