1 2Translating aprsc status view to other languages 3=================================================== 4 5Create a new language file 6---------------------------- 7 8Go to /opt/aprsc/web, and make a copy of the master English strings file. 9Look up your two-letter language code from 10[the list](https://www.w3.org/International/articles/language-tags/) 11('sv' is for Swedish, for example), and use it to construct the file name. 12 13 cd /opt/aprsc/web 14 cp strings-en.json strings-sv.json 15 16Edit strings-sv.json with your favourite editor, translate all 17the strings. Make sure you use UTF-8 encoding in your editor 18and terminal. 19 20 21Reconfigure or restart aprsc 22------------------------------- 23 24The aprsc process will scan for string files at startup and when 25reloading configuration. This step will only need to be done once 26after creating the new string file - after further edits of strings, 27simply reload the status web page. 28 29To reload configuration, execute the `reload` option of the startup script. 30 31On Ubuntu or Debian: 32 33 sudo service aprsc reload 34 35On Centos (and others): 36 37 sudo /etc/init.d/aprsc reload 38 39 40Add new language mapping 41--------------------------- 42 43Edit /opt/aprsc/web/aprsc.js - in the beginning you'll find two 44statements which need to be adjusted: 45 46 // add additional language codes here, in the end of the list: 47 var lang_list = ['en', 'fi']; 48 // and, if necessary, add one new line in the beginning here, 49 // for dialect mapping (en_US, en_GB to en): 50 var lang_map = { 51 'en_*': 'en', 52 'fi_*': 'fi', 53 '*': 'en' // DO NOT remove or change the default mapping to 'en' 54 }; 55 56For Swedish translation, the first list would become: 57 58 var lang_list = ['en', 'fi', 'sv']; 59 60If Swedish would have dialects ('sv_FI' for Swedish spoken in Finland) 61then the mapping for the variants can be added. Otherwise, only clients 62requesting plain 'sv' for language will get the translation. 63 64 var lang_map = { 65 'en_*': 'en', 66 'fi_*': 'fi', 67 'sv_*': 'sv', 68 '*': 'en' 69 }; 70 71Pass new translation to upstream aprsc code 72---------------------------------------------- 73 74Give your new translation back to the aprsc project, so that it will be 75included in future versions automatically, and that it'll be installed 76on other servers too. 77 78