From 20e0449edcdd1414208b6081e1b5f1ecea76b1c1 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sun, 1 Mar 2015 01:01:28 +0200 Subject: [PATCH] Update HOWTO.md --- locale_build/HOWTO.md | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/locale_build/HOWTO.md b/locale_build/HOWTO.md index e69de29..c4d593f 100644 --- a/locale_build/HOWTO.md +++ b/locale_build/HOWTO.md @@ -0,0 +1,54 @@ +## ADD SUPPORT FOR NEW LANGUAGE + +**Requires**: [GNU GetText](https://www.gnu.org/software/gettext/) (Only if you want to build the MO files on your own) + +1. Clone or Fork the repository +2. Go to **youtube-dl-gui/locale_build** directory +3. Copy **youtube_dl_gui.po** to a new file (e.g. gr.po) +4. Edit the new file with your favorite text editor (See *EDIT* section) +5. After you have finished the file editing save the file +6. Now you have two options + 1. Send me the translated PO file to this email address: ytubedlg@gmail.com + 2. Build the binary translation file (MO) on your own using the build scripts (See *BUILD* section) + +### EDIT +PO file headers informations: +https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html + +To translate the PO file just edit the **msgstr** fields + +**Example** +``` pot +#: mainframe.py:78 +msgid "Download" +msgstr "Add the translation here" +``` + +### BUILD +1. To build the MO file you need to run the corresponding build script for your OS + + **Windows**: build_locale.**bat** + + **Linux**: build_locale.**sh** + + **Example** + + Usage: *build_locale.sh* <*language code*> <*translated PO file*> + + $ ./build_locale.sh *gr_GR* *gr.po* + +2. Now you also need to add the corresponding language option under the options frame localization tab + 1. Open optionsframe.py + 2. Locate the LocalizationTab class + 3. Find the LOCALE_NAMES attribute + 4. Add your language to the LOCALE_NAMES + + **Example** + ``` python + LOCALE_NAMES = twodict([ + ('en_US', 'English'), + ('gr_GR', 'Greek') + ]) + ``` + +3. Save the file and now you can make a new pull request after you push your changes to your remote