Volume Control
Application-specific hotkeys for Windows
|
This is intended as a guide for contributors looking to provide language translations for Volume Control. It describes in depth how to edit existing translations, create new translations, and submit pull requests on Github.
For a comprehensive overview of how Volume Control implements translations, see the documentation for the localization nuget package we use: CodingSeb.Localization.
This is the simplest way for a complete beginner to get started; if you're already familiar with Github you can use any method that you prefer.
After a short wait, your forked repository should load.
If it doesn't open automatically, you can find your fork at this URL:
https://github.com/<YOUR_GITHUB_USERNAME>/volume-control
.
/>
) to open Github's browser-based version of VS Code *(referred to from here on as the "editor")*.VolumeControl/Localization
. The VolumeControl/Localization
directory contains translation configuration files that are responsible for providing translated strings to Volume Control. Each translation config file should contain translated strings for exactly ONE (1) language.
Translation configs can be in either JSON or YAML format, but JSON is preferred. Don't worry if you aren't familiar with JSON files, you don't need to know anything about them to provide translations *(but it will help with understanding the instructions)*.
Translation config files must be named <LOCALE_ID>.loc.json
, where <LOCALE_ID>
is the 2-character ISO 639-1 language code of the language defined within that file. You're probably already familiar with the locale ID of your language as you've probably seen it in other places before. If you're unsure, or just double-checking, you can find the code associated with your language under the 639-1
column of this table on wikipedia.
For example, the locale ID of English is en
, so the en.loc.json
file contains translations for the English language.
Each translated string used by Volume Control is accessed via a PATH that corresponds to the structure of the translation config file. These paths are named and organized in such a way as to *(loosely)* represent the underlying XAML code that defines the structure of the window.
These path names MUST be in English and cannot be changed!
For example, the path VolumeControl.MainWindow.CaptionBar.Title.Content
refers to the window title:
and appears in the translation config as a series of nested JSON objects with a JSON string value in it:
Translated strings are provided as JSON string values in the format "<LANGUAGE_NAME>": "<STRING>"
, where <STRING>
is the translated string and <LANGUAGE_NAME>
is the language name shown in the settings tab:
Language names MUST be consistent throughout the entire file! Any translated strings defined with a typo in the language name will be interpreted as a seperate language.
For this reason, it is HIGHLY recommended to use the Find & Replace feature *(CTRL+F ➔ Click on the arrow icon)* instead of typing the name every time:
If you follow the instructions in this guide, you won't need to worry about the actual structure of the translation config file beyond ensuring it matches the structure of en.loc.json
.
Open the translation config file *(found in VolumeControl/Localization
)* associated with the translation you want to modify, then proceed to Add a Missing Translated String or Change an Existing Translated String.
Removing a translated string is fairly self-explanatory; simply delete the sections you want to remove from your translation config file.
en.loc.json
and paste it into the correct position(s) in your translation config file.English (US/CA)
to your language name using the find & replace tool *(CTRL+F ➔ Click on the arrow icon)*.VolumeControl/Localization
directory *(R+Click ➔ New File)*. en.loc.json
file into the new file.English (US/CA)
and replace it with the name of your language.\n
), tabs (\t
), and macros (${ID}
), or the translated string will not appear correctly. Changes that you make in the editor will not appear in your forked repository until you push them.
Your forked repository will now contain your changes, and you're ready to submit a pull request.
Pull Requests (PRs) are Github's way of pushing changes across forked repositories. By submitting a pull request, you can contribute to Volume Control directly, and your Github username and picture *(if you have one)* will appear in the Contributors section of the main repository:
You're all done! The developers will review your pull request and merge the changes if everything looks good, otherwise they will ask you to make changes first. For more information, see Updating a Pull Request.
If the developers ask you to make changes to your pull request before merging it, you can do this by simply pushing the changes to your forked repository as described in Pushing Your Changes. No further action is required on your part to update the PR as this happens automatically.