Jump to content

Photo

Translating Vortex


  • Please log in to reply
1 reply to this topic

#1
Tannin42

Tannin42

    Faithful poster

  • Staff
  • PipPipPipPip
  • 1,131 posts

At this time there is only very basic support for translating Vortex but I thought I'd share a few hints

  • Bundled translations are located in
    C:\Program Files\Black Tree Gaming Ltd\Vortex\resources\locales
    one directory per language
    Translations you are editing should be placed in
    C:\Users\<username>\AppData\Roaming\vortex\locales
    though, or
    C:\ProgramData\vortex\locales
    if you're using shared mode.
    If you're working on an existing translation, copy the translation file from the bundled location to the custom one.
  • The directory name has to be the ISO 639-1 language code as listed here: https://en.wikipedia...ISO_639-1_codes so to add a Portugese translation you would create 
     
    C:\Users\<username>\AppData\Roaming\vortex\locales\pt
  • The language directory contains different files for different areas of the application to translate, currently those are common.json, dependency-manager.json, gamebryo-plugin.json, problems.json and profile-management.json with common containing the vast majority of translations.
  • Each file is in json format, an empty file should at least contain 
    {}
    to be valid.
  • For a translation to load without error it needs to have at least a common.json file.
  • The existing translation (german) is wildly outdated unfortunately
  • The translation system supports placeholder texts like this:
    {{ foobar }} is a placeholder

    Where the {{ foobar }} part will be replaced at runtime

  • The translation system is also used to support plural forms and thus is also used for english on certain texts, this could look like this:
    "{{ count }} conflicting file": "One conflicting file",
    "{{ count }} conflicting file_plural": "{{ count }} conflicting files"

    This is the translation for one text (conflicting file) but depending on the count parameter it will use the first translation if the count is 1 and the second text if it's multiple. This feature is the reason we also use "translation" for english texts.
    Afaik this also supports languages that have more than one plural form, contact me if you need help for that.

  • To ease translation there is an optional extension at https://github.com/N...nsion-translate (requires Vortex 0.14.1)
    • Download the latest release and extract according to the instructions on the github page
    • Restart Vortex
    • At the bottom of Settings->Interface you should now have a new drop-down with all known languages, you can start a translation for a new language there.
      You don't have to go this way to create a language, you can also just create the directory as described above.
    • Once you created a custom language in the appdata/programdata directory you can select it in the languages dropdown.
    • As long as you have the extension active and a custom language selected, vortex will automatically add any missing translations to the translation files for the selected language.
    • You can edit the translation files while vortex is running, it will automatically update most texts (not all unfortunately) as soon as you save the translation files. Don't click around in Vortex while you still have unsaved changes in the translation file though, otherwise Vortex updating the translation files may cause you to lose your changes.
    • Please make sure you don't damage the file syntax of the translation files.


#2
ZakiTaki

ZakiTaki

    Newbie

  • Premium Member
  • 16 posts

Here's what I would suggest if you want to have a easier time translating, as sometimes the extension will make copies of translations already found earlier and that you have modified. (It's especially notorious for trying to copy the chrome fix tooltip details even if they already exist, it does not happen always). Requiring you to delete these over and over again almost every time the translation extension tries to find missing translations. It also does not make a distinction between a purely technical log message for example. So if the extension is running and you open a error. Then that will be put in to sometimes. Obviously you cannot translate these as the errors are dynamic and this would just cause problems. So if this happens during my suggested process. Remove them afterwards. 0.3 of my Swedish translation will contain all these changes, just edit the translation part to whatever language remote and far that you want to translate for, and build upon it.

 

The extension is otherwise a great help in finding what you need to translate that is not covered by the commons.json example in the (de) on the github page. And there's plenty of them. The instructions are kinda long so bear with me (DO NOT start translating your commons.json or any other file produced in your language folder until you are done with all the steps!)

 

  1. Start Vortex in a clean state (as in fresh installation)
  2. Enable the extension and choose the language you want to translate for.
  3. Click trough every single option, space, view, window etc available with no games choosen, logged out. (Yes all of them, even textboxes and checkmarks to be sure and click on all info/tooltip signs)
  4. Click trough every single option, space, view, window etc available with no games choosen, logged in. (Yes all of them, even textboxes and checkmarks to be sure and click on all info/tooltip signs)
  5. Choose a game (for example Skyrim).
  6. Click trough everything with no mods/plugins installed.
  7. Install at least 3 plugins.
  8. Click trough every single option available again. Any button you can press? Press that thing so hard that the translation will beg to be translated. (This includes the NNM and MO import/migration tools so you can translate the not found messages for these etc)
  9. Close Vortex.
  10. Install NMM, Choose a game (for example skyrim) and install 2-3 dummy mods/plugins or any mod/plugin really.
  11. Ensure that NMM is working correctly. Then close it.
  12. Do the same for MO.
  13. Now start Vortex again, and again if you missed clicking anything or switching between settings. Do it.
  14. Now start the NMM import tool and try to import so the extension can capture the words so you can translate these.
  15. Do the same for MO.
  16. After this, rip the latest commons.json from the (de) on the vortext github page. For example "Dashboard" is not captures by the extension for some weird reason. Bring in anything from it that was not captured and added to your own commons.json by the extension.
  17. Shut off the extension so it stops capturing things.

If you have done this correctly. Your commons.json for your language should now contain a HUGE (and I mean HUGE) amount of words and text that are just begging to have you take part and help. And this includes whatever you found in the (de) commons.json that was missing. It can take several tries sometimes for it to add the missing translations. So it's worth it to repeat this once or twice more ontop of all this.

 

You can now in peace and quiet translate everything.

 

Troubleshooting:

  • My words leak (also called overflow) outside buttons.

This happens (unless tannin says otherwise or I misunderstood what is happening) because the buttons do not seem to dynamically resize themselves according to text length to make it fit (they do have some sort of word wrap enabled however, so it only leaks vertically). Try to find another word/words to describe the action. This could be solved by decreasing font-size in the theme editor (or editing the CSS files yourself if you are tech savy). But with respect for those who have poor eye-sight, try to make it stay inside the button for as many font-sizes as possible.

  • I get errors about that the language file failed to initialize 

Somewhere in your language file the syntax is wrong. This can happen if you edit the commons.json WHILE you have the extension activated (and most likely caused by a , at the end before the closing bracket). Ensure that the syntax is correct. You also DO NOT want to add a , at the last part. So check that your syntax is correct.

Right:
{
"Original": "Edited",
"Original": "Edited"
}

Wrong:

{
"Original": "Edited",
"Original": "Edited",
}

Or any variation when the syntax is broken, such as placing the translations outside of the brackets. It could also be because you edited the Original part. DO NOT DO THAT PLS.

 

Adding onto Tannins examples. Here are how you escape certain characters that could break the syntax and how to make a new line (i will update this when I figure out how to make my own dots):

 

\Symbol will escape certain characters. (You will need to escape almost everything inside of your translation that could be interpreted as being part of the syntax. This is also a common way to get that failed to load/initialize error. , characters inside of the main "" does not seem to need escaping)

 

Example: \" will let you type like this:

{
"Well duh, \"Skyrim\" is the best game evah!": "Men öh, \"Skyrim\" är typ det bästa spelet någonsin!",
"Original": "Edited"
}

This will produce in the translations

Original

Well duh, "Skyrim" is the best game evah!

Edited

Men öh, "Skyrim" är typ det bästa spelet någonsin!

If you do not escape the characters, the syntax is broken and so is your translation file, so Vortex is going to nope out of there faster than you can realize it. So far I have only seen that " and \ needs escaping (anytime you want to represent the \ somewhere, just do \\. Example further down.

 

\n

 

This stands for NewLine and is a common way in "programming jumbo" to tell the computer to create a new line. Just pressing ENTER does not always work, so we use this to create new lines and divide up your text

so it does not look like the following.

gweeowjgweopjgpwejgåpwjpgojpewjpgweeowjgweopjgpwejgåpwjpgojpewjpgweeowjgweopjgpwejgåpwjpgojpewjpgweeowjgweopjgpwejgåpwjpgojpewjpgweeowjgweopjgpwejgåpwjpgojpewjp

or 

gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp

And instead so much nicer:

gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp

gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp
gweeowjgweopjgpwejgåpwjpgojpewjp

gweeowjgweopjgpwejgåpwjpgojpewjp

Makes a world of difference in readability.

 

Example:

{
"Dashboard": "Look mah I am \nBreaking the \n\nINTERNETS",
"Settings": "Sett\nings"
}

Which produces the following:

Edited:

Look mah I am
Breaking the


INTERNETS

Edited:

Sett
ings

And finally. If you need to escape showing filepaths in the text. Just do a double \

Example where a backlash is the way you want to show the filesystem path:

C:\\MyPotatoFolder\\MyPotatoes

Example where you want to represent it with a forward slash.

C:/MyPotatoFolder/MyPotatoes


Ergo Forward slash do not need escaping. Backslashes do.

In the context on the syntax:

{
"C:\\MyPotatoFolder\\MyPotatoes": "C:\\MinPotatisMapp\\MinaPotatisar"
}

{
"C:/MyPotatoFolder/MyPotatoes": "C:/MinPotatisMapp/MinaPotatisar"
}

Which finally results in:

Original
C:\MyPotatoFolder\MyPotatoes

Edited
C:\MinPotatisMapp\MinaPotatisar

Original
C:/MyPotatoFolder/MyPotatoes

Edited
C:/MinPotatisMapp/MinaPotatisar

RESERVED






Page loaded in: 0.628 seconds