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)
(… which actually goes here.)
Line 6: Line 6:
* If the language does not exist in MediaWiki's [https://web.archive.org/web/20210323103701/https://doc.wikimedia.org/mediawiki-core/1.23.1/php/Names_8php_source.html Names.php], you have to add it manually. (This is the case for alternative translations)
* If the language does not exist in MediaWiki's [https://web.archive.org/web/20210323103701/https://doc.wikimedia.org/mediawiki-core/1.23.1/php/Names_8php_source.html Names.php], you have to add it manually. (This is the case for alternative translations)
** <div class="server">In <code>/var/www/thpatch/w/LocalSettings.php</code> add a line like <code>[[mw:Manual:$wgExtraLanguageNames|$wgExtraLanguageNames]]['<em>xx</em>'] = '<em>My new language</em>';</code>.</div>
** <div class="server">In <code>/var/www/thpatch/w/LocalSettings.php</code> add a line like <code>[[mw:Manual:$wgExtraLanguageNames|$wgExtraLanguageNames]]['<em>xx</em>'] = '<em>My new language</em>';</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>
:::<code>php7.4 extensions/UniversalLanguageSelector/data/LanguageNameIndexer.php</code>
* <div class="wikiadmin">Add patch &rarr; language code mapping to the [[Template:thcrap TL patches|thcrap_tl_patches]] hook located at [[Patch:Translatable content/Supported languages]].</div>
* <div class="wikiadmin">Add patch &rarr; language code mapping to the [[Template:thcrap TL patches|thcrap_tl_patches]] hook located at [[Patch:Translatable content/Supported languages]].</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">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:21, 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';.
    • (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: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".
  • 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
}}