User:Egor/How to add a language: Difference between revisions

From Touhou Patch Center
Jump to navigation Jump to search
(There will be a 7. step after the update. Putting it here already in case I forget)
Line 9: Line 9:
** <div class="server">Ensure that this actually worked by running <code>mysql thpatch -e "SELECT * FROM tpc_tl_patches WHERE tl_patch = 'lang_<em>xx</em>';"</code>.</div>
** <div class="server">Ensure that this actually worked by running <code>mysql thpatch -e "SELECT * FROM tpc_tl_patches WHERE tl_patch = 'lang_<em>xx</em>';"</code>.</div>
** <div class="server">If it didn't work, <code>cd /var/www/thpatch/w/extensions/TouhouPatchCenter/maintenance</code> and run <code>./kick.sh "Patch:Translatable content/Supported languages"</code>.</div>
** <div class="server">If it didn't work, <code>cd /var/www/thpatch/w/extensions/TouhouPatchCenter/maintenance</code> and run <code>./kick.sh "Patch:Translatable content/Supported languages"</code>.</div>
* <div class="server">(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:</div>
  php7.4 extensions/UniversalLanguageSelector/data/LanguageNameIndexer.php
* Create [[Patch:Lang xx|Patch:lang_<em>xx</em>]] with the following as content, modifying the dependencies as needed.
* Create [[Patch:Lang xx|Patch:lang_<em>xx</em>]] with the following as content, modifying the dependencies as needed.
  <nowiki>{{</nowiki>thcrap Patch Info
  <nowiki>{{</nowiki>thcrap Patch Info

Revision as of 22:12, 12 April 2021

  • 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';.
  • Add patch → language code mapping to the thcrap_tl_patches hook located at Patch:Translatable content/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 ./kick.sh "Patch:Translatable content/Supported languages".
  • (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
  • 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
}}