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.

70 lines
2.5 KiB

9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
7 years ago
7 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
7 years ago
9 years ago
9 years ago
7 years ago
9 years ago
7 years ago
  1. ## ADD SUPPORT FOR NEW LANGUAGE
  2. ### Requirements
  3. - [GNU gettext](https://www.gnu.org/software/gettext) (To build the .MO files)
  4. ### Notes
  5. - Do **NOT** send me the PO files via email since i'm not looking at them anymore
  6. - See the **Help** & **Helpful links** sections below for help
  7. - The instructions below assume basic knowledge of the command line (OS independent)
  8. - Binary translation files (.MO) built during step 7 are only for the translator to test his work (in step 8) and you should **NOT** force push them
  9. - Make sure to update the following headers in the **PO** file:
  10. - **PO-Revision-Date** - update the revision date
  11. - **Last-Translator** - provide valid contact information
  12. ---
  13. ### Getting started
  14. 1. Fork the project
  15. 2. Create a local clone of your fork repo
  16. 3. Change directory into **youtube-dl-gui**
  17. 4. Run the **new-locale.py** script under the **devscripts** directory:
  18. `python new-locale.py language_code_here`
  19. 5. Edit the created **PO** file with your favorite editor
  20. 6. Add the new language in the **optionsframe.py** file
  21. 7. Build the binary translation files (.MO) using the **setup.py** script:
  22. `python setup.py build_trans`
  23. 8. Test the translations by running youtube-dl-gui:
  24. `python -m youtube_dl_gui`
  25. 9. Push your changes:
  26. ```
  27. git add -A
  28. git commit -m "Your commit message here"
  29. git push origin master
  30. ```
  31. 10. Open a new pull request
  32. ---
  33. ### Help
  34. - The **language code** being used should be in the format `<ISO 639-1>_<ISO 3166-1 alpha-2>` (e.g. en_US)
  35. - To translate the PO file just edit the **msgstr** fields as shown below:
  36. ``` pot
  37. msgid "Download"
  38. msgstr "ダウンロード"
  39. ```
  40. - In order for youtube-dl-gui to display the new language you must add it to the **optionsframe.py** file:
  41. 1. Open **optionsframe.py** with your favorite editor
  42. 2. Locate the **LOCALE_NAMES** attribute
  43. 3. Add your language to it (make sure to **sort alphabetically** based on the language name)
  44. ``` python
  45. LOCALE_NAMES = twodict([
  46. ('en_US', 'English'),
  47. + ('ja_JP', 'Japanese')
  48. ])
  49. ```
  50. ---
  51. ### Helpful links
  52. - [Creating a pull request](https://help.github.com/articles/creating-a-pull-request)
  53. - [Fork A Repo](https://help.github.com/articles/fork-a-repo)
  54. - [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
  55. - [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
  56. - [PO file headers](https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html)