Jump to content
Heavy Traffic ×

Translating Vortex


Tannin42

Recommended 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.org/wiki/List_of_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://www.nexusmods.com/site/mods/28 (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.
Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

  • 5 months later...

I tried installing extension-translate to translate Vortex, but it caused the following error: "not an extension, info.json missing"

Can I use this extension with the latest Vortex? Without this extension will not add missing-translation to common.json?

I don't want to annoy you about translation as I know you now have other work to give priority. I will wait till then if you have plans on translation support in the future, so please tell me the plan of translation support.

 

EDIT: Apparently I can get the translation text from the source code (.ts/.tsx) by extracting string literals such as "t('Enabled')", but there are some exceptions "toEqual('{{ count }} month ago')" or "title: 'Check for Update'", so I'm not sure. Any advice?

Edited by BowmoreLover
Link to comment
Share on other sites

Thanks Tannin, I could install the new archive correctly, but when restarting Vortex the extension got "Failed" state, and the following message was found in vortex.log : "info: extensions ignored for using unsupported api extensions=translate"

Any ideas?

Link to comment
Share on other sites

Thanks for update!
I was able to create a language folder and json file by selecting a language from the new dropdown in the Settings menu. Also I added a line to the json file and confirmed that the UI will be translated.
But I'm sorry to say, entries are not added to the json file by manipulating or clicking on the UI. Just to be sure I uninstalled the Vortex custom location version and changed it to the default version, but it does not worked well. What's wrong?

Link to comment
Share on other sites

It worked well! Thank you soooo much! Finally I can translate into Japanese :smile:

There is only one minor issue but it can be easily avoided.
If there is no '%APPDATA%\Vortex\locales' folder, creating the translation language will result in the following error: "An unrecoverable error occurred: ENOENT: no such file or directory, open 'C:\Users\UserName\AppData\Roaming\Vortex\locales\ja\common.json'", so you need to create "%APPDATA%\Vortex\locales" folder before installing translation-helper extension (Or you can ignore error and restart Vortex and just dismiss the error notification, json files will be created).

Edited by BowmoreLover
Link to comment
Share on other sites

  • 2 weeks later...

Hi there, I'm just released a tool that may help Vortex translators here: https://www.nexusmods.com/site/mods/33

- You can extract translation text from Vortex source code as a translation source.
- You can convert Json to/from Mcm(*) file, so translate it easily using such as xTranslator instead of directly editing Json.
- You can use almost complete English Json files as a translation source.

 

Just try it and give me the suggestions :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...