User:Egor/How to add a language

From Touhou Patch Center
Jump to: navigation, search
  • If the language does not exist in MediaWiki's Names.php, you have to add it manually. (This is the case for alternative translations)
    • In /var/www/thpatch/w/LocalSettings.php add a line like $wgExtraLanguageNames['xx'] = 'My new language';.
    • (once MediaWiki has been updated) Generate new UniversalLanguageSelector search data, to make the new language searchable by its title in addition to its language code:
php7.4 extensions/UniversalLanguageSelector/data/LanguageNameIndexer.php
  • Add patch → language code mapping to the thcrap_tl_patches hook located at Patch:Supported languages.
    • Ensure that this actually worked by running mysql thpatch -e "SELECT * FROM tpc_tl_patches WHERE tl_patch = 'lang_xx';".
    • If it didn't work, cd /var/www/thpatch/w/extensions/TouhouPatchCenter/maintenance and run ./ "Patch:Supported languages".
  • Create Patch:lang_xx with the following as content, modifying the dependencies as needed.
{{thcrap Patch Info
|title=My new language patch
|dependencies=nmlgc/base_tsa, nmlgc/base_tasofro, nmlgc/script_latin, nmlgc/western_name_order