Skip to content

How to translate CAP

viral32111 edited this page Apr 2, 2020 · 1 revision

If you want to translate the Carter Addon Pack to your language, or improve/update it an existing one, then please continue reading.

Important notes:

  • Lines/Sentences that have "//" before it will be commented out and won’t be shown in game, this shouldn’t be included in any translation sentences other than actual comments.
  • Inside the stargate.lua file there is a line called "global_lang_name", it should contain the full language name as this is required to be shown correctly when selecting your language in the setting tab.
  • Inside the stargate.lua file there is a line called "spawninfo_multi_url", you can replace it to the url with your own language support thread located in this forum. External forums are not allowed! The field "spawninfo_multi" can be renamed to "Your_language support".
  • Inside the stargate.lua file there is line called "stargate_settings_08", where you state the author(s) of the translation.
  • You can read about few useful commands what will help you test your translation on the bottom of page.

Creating a new translation for Carter Addons Pack

1. Start off with the English Base files which are located in: Steam\steamapps\common\GarrysMod\garrysmod\addons\cap\lua\data\language\en If you're using the workshop version then you can download the files here: https://github.com/RafaelDeJongh/cap/tree/master/lua/data/language/en.

If you downloaded via github them manually create the "en" folder in: Steam\steamapps\common\GarrysMod\garrysmod\lua\data\language\

2. When you've located/obtained the files and placed them in the right location and then change the "en" folder with SHORT_LANGUAGE_NAME that you'd like to translate CAP into like so: Steam\steamapps\common\GarrysMod\garrysmod\lua\data\language\SHORT_LANGUAGE_NAME

If GMOD supports your language, you can get this value by typing in console "gmod_language". If not then you can get the short name by searching for it on Google.

Some Garry's Mod languages can have the following format: "sv-se" so if this is the case you also need to name the folder that way. Example of a SHORT_LANGUAGE_NAME would be: English - en

3. The third step is to translate the actual files, in case you don't translate a string/sentence then please remove it from the files as non translated or missing sentences will automatically be taken from the English translation. This is required as we might change the English Files and that we don't need to change the same English sentence in each other language file.

4. After translating you need to save the file in UTF8 charset (if you're using Notepad++ then all symbols should be converted to UTF8 without boom). If you do not save the file with the correct UTF8 Charset then all special characters and symbols in your language (like Č á ý etc) will not work in-game!

5. The next step is to test your language in game. There are chances that the length of the sentences exceeds the menu/description so if this happens then you require to use different and shorter words. Make sure all the files works completely and that there are no errors at all or we might not accept it therefore test everything correctly and this also means not the main setting menu but also entities that use menu's like: the Asgard transporter, destiny timer, dakara weapon and so on.

6. If you made sure everything is working as it should, then you can create a pull request in the CAP Github Repository which can be found here: https://github.com/RafaelDeJongh/cap/pulls

7. After a language pull has been made, we on our side controlate the files to see if everything is working fine, and then we will add it to the next update from CAP.

Updating an existing language

1. Go to the following directory: Steam\steamapps\common\GarrysMod\garrysmod\addons\cap\lua\data\language\ And depending on your language that you want to update you choose the folder with the Shortened Language Name.

2. Make sure you have the latest version of the language files, to make sure you have the lates version you could always download them from this link: https://github.com/RafaelDeJongh/cap/tree/master/lua/data/language

3. Start by comparing the language you want to update and the English translation, as there might be various differences between the one you're updating and the always latest version of the English Language base.

4. Now is to actually update the language and translate missing sentences in case this is needed.

5. After updating you need to save the file in UTF8 charset (if you're using Notepad++ then all symbols should be converted to UTF8 without boom). If you do not save the file with the correct UTF8 Charset then all special characters and symbols in your language (like Č á ý etc) will not work in-game!

6. The next step is to test your language in game. There are chances that the length of the sentences exceeds the menu/description so if this happens then you require to use different and shorter words. Make sure all the files works completely and that there are no errors at all or we might not accept it therefore test everything correctly and this also means not the main setting menu but also entities that use menu's like: the Asgard transporter, destiny timer, dakara weapon and so on.

7. If you made sure everything is working as it should, then you can create a pull request in the CAP Github Repository which can be found here: https://github.com/RafaelDeJongh/cap/pulls

8. After a language pull has been made, we on our side controlate the files to see if everything is working fine, and then we will add it to the next update from CAP.

Useful console commands:

  • sg_language_reload - reloads the language files. This is useful for debugging cap menus, but if you update the spawn menu you should restart the map.
  • gmod_language - get/set GMOD language.
  • sg_language - get/set Stargate language, after entering this enter sg_language_reload.
  • CAP_Outdated - displays update checker message (displays for github users on update).
  • CAP_dxlevel - displays directx level warning message (for debug).
  • CAP_debugerror - manually display all cap errors in motd window. You can also specify only one error by typing "CAP_debugerror 9".
  • stargate_settings - opens cap settings menu.