You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

9 years ago
  1. ## ADD SUPPORT FOR NEW LANGUAGE
  2. **Requires**: [GNU GetText](https://www.gnu.org/software/gettext/) (Only if you want to build the MO files on your own)
  3. 1. Clone or Fork the repository
  4. 2. Go to **youtube-dl-gui/locale_build** directory
  5. 3. Copy **youtube_dl_gui.po** to a new file (e.g. gr.po)
  6. 4. Edit the new file with your favorite text editor (See *EDIT* section)
  7. 5. After you have finished the file editing save the file
  8. 6. Now you have two options
  9. 1. Send me the translated PO file to this email address: ytubedlg@gmail.com
  10. 2. Build the binary translation file (MO) on your own using the build scripts (See *BUILD* section)
  11. ### EDIT
  12. PO file headers informations:
  13. https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html
  14. To translate the PO file just edit the **msgstr** fields
  15. **Example**
  16. ``` pot
  17. #: mainframe.py:78
  18. msgid "Download"
  19. msgstr "Add the translation here"
  20. ```
  21. ### BUILD
  22. 1. To build the MO file you need to run the corresponding build script for your OS
  23. **Windows**: build_locale.**bat**
  24. **Linux**: build_locale.**sh**
  25. **Example**
  26. Usage: *build_locale.sh* <*language code*> <*translated PO file*>
  27. $ ./build_locale.sh *gr_GR* *gr.po*
  28. 2. Now you also need to add the corresponding language option under the options frame localization tab
  29. 1. Open optionsframe.py
  30. 2. Locate the LocalizationTab class
  31. 3. Find the LOCALE_NAMES attribute
  32. 4. Add your language to the LOCALE_NAMES
  33. **Example**
  34. ``` python
  35. LOCALE_NAMES = twodict([
  36. ('en_US', 'English'),
  37. ('gr_GR', 'Greek')
  38. ])
  39. ```
  40. 3. Save the file and now you can make a new pull request after you push your changes to your remote