Skip to content

Localizing Amethyst

公彦赤屋先 edited this page Jun 4, 2022 · 19 revisions

Welcome to the Amethyst-Releases wiki!

This page will help you understand how to localize (translate text resource files for):

  • Amethyst's Crash Handler ------- the easiest one
  • Amethyst's Devices/Plugins ----- the middle one
  • Amethyst (Desktop) ------------- the biggest one

How to localize/translate the Crash Handler

Translate/Localize Amethyst's Recovery/Crash Handler:

1: Create a new node folder under "Crash Handler" for your language code,
there are 2 already created ("en-US" and "fr-FR")

2: Copy "Resources.resw" from "en-US" to your newly created folder.

3: Open the file as text (it's just an XML file) and translate each node into your chosen language.
You can do just one at a time.

For example, this is the node for the key Title.AlreadyRunning in English:

<data name="Title.AlreadyRunning" xml:space="preserve">
    <value>Amethyst Already Running!</value>
</data>

and this is the same key in French:

<data name="Title.AlreadyRunning" xml:space="preserve">
    <value>Amethyst est déjà lancé!</value>
</data>

When editing multiline keys, remember that you can't use a simple \n
to create a "virtual" new line. A new line in the <value> is a new line in the UI.
The same goes for spaces and tabs, so please don't format the file too much.

To have a grasp on how an English→{Your language} file would look like,
please see the already-translated "fr-FR" resources file. Have fun!

How to localize/translate the Devices/Plugins

Translate/Localize Amethyst's Plugins:

1: Open the LocalizedStatuses.h file under your selected device plugin.
(It's a text file with a header extension for the language Amethyst is written in: C++)

2: For each map in the file, create a new node ({ "", "" })
This is the map for status_ok, before adding a second language:

inline std::map<std::wstring, std::wstring> status_ok_map
{
	{
		L"en-US",
		L"Success!\nS_OK\nEverything's good!"
	}
};

And this is it after adding the new language:

inline std::map<std::wstring, std::wstring> status_ok_map
{
	{
		L"en-US",
		L"Success!\nS_OK\nEverything's good!"
	}, // Add a comma here, between the nodes
	{
		L"lc-LC",
		L"Shucshesh!\nS_OK\nEvewytshin's gud!"
	}
};

As you see, it's pretty much the same as JSON.
Anyway, please be careful with \n's! The status is parsed using them,
so if you break even one, it's gonna break the whole end status.
I know it's kinda infuriating, I know... But for real, please watch out for these.

Add a new node for each of the status maps,
with the first key being your language code (like "fr-FR") and the second key
being the localized status. Also, please remember to put L's before the first "'s.

How to localize/translate Amethyst

Translate/Localize Amethyst

Frontend

1: Create a new node folder under "Amethyst/Interface" for your language code.

2: Copy all the .resw files from "en-US" to your newly created folder.

3: Open each file as text (it's just an XML file) and translate each node into your chosen language.
You can do just one at a t Amethyst Translator Pack.zip ime.

For example, this is the node for the key Captions.Filters.Position in English:

<data name="Captions.Filters.Position" xml:space="preserve">
    <value>Position Tracking Filter:</value>
</data>

and this is the same key in Cat:

<data name="Captions.Filters.Position" xml:space="preserve">
    <value>Pshishion Twackwing Fiwteww:</value>
</data>

When editing multiline keys, remember that you can't use a simple \n
to create a "virtual" new line. A new line in the <value> is a new line in the UI.
The same goes for spaces and tabs, so please don't format the file too much.

To have a grasp on how an English→{Your language} file would look like,
please see the already-translated "fr-FR" resources file. Have fun!

Backend

1: Open the LocalizedServerStatuses.h file under "Backend".
(It's a text file with a header extension for the language Amethyst is written in: C++)

2: For each map in the file, create a new node ({ "", "" })
This is the map for status_ok, before adding a second language:

inline std::map<std::wstring, std::wstring> status_ok_map
{
	{
		L"en-US",
		L"Success! (Code 1)\nI_OK\nEverything's good!"
	}
};

And this is it after adding the new language:

inline std::map<std::wstring, std::wstring> status_ok_map
{
	{
		L"en-US",
		L"Success! (Code 1)\nI_OK\nEverything's good!"
	}, // Add a comma here, between the nodes
	{
		L"lc-LC",
		L"Wohoo! (Code 1)\nI_OK\nAll gud!"
	}
};

As you see, it's pretty much the same as JSON.
Anyway, please be careful with \n's! The status is parsed using them,
so if you break even one, it's gonna break the whole end status.
I know it's kinda infuriating, I know... But for real, please watch out for these.

Add a new node for each of the status maps,
with the first key being your language code (like "fr-FR") and the second key
being the localized status. Also, please remember to put L's before the first "'s.


Localization FAQ

Is using machine translation okay? To the limit that you can be 100% confident what you wrote is proper,
you are allowed to use services like DeepL or Google Translate to HELP you.
Not to write the whole thing.
I want to see how it will look in the app! The font used in WinUI 3 is Segoe UI Variable,
usually the SemiBold variant of the fixed weight version should match.

If you ask me, I'll make you mock-ups of how a string would look inside the UI.
Or you can do it yourself using design software like Figma or Lunacy.

I know having live builds to see how text will end up would be better,
but the main repo is staying private until release, building the app locally isn't hard,
but asking that of every person interested in localizing seems a bit much.
For now, we'll go with "try to make the text about the same length."
What about a CLA? How is that gonna work? I would like to hear everyone's voices on this.
You will obviously be credited in the app's info page for your localization work
(You can request to stay anonymous).
Everything you publish to Amethyst will be licensed under GPLv3
unless an agreement is made between parties for partial licenses.
How do I submit work? Because the repository is still private, submit it on Discord I guess?
You can also open an issue or a discussion (if available) in this repo.
What about future features and additions? You're welcome to update your translations in the future,
it would be super appreciated actually!
Either to fix errors, or support new features.

That said, you're gonna find the exact same instructions in the zip provided below.
That is, of course along with the needed string resource files, yay

You can download the zipped resource files here

Clone this wiki locally