Topic on Extension talk:Translate

Jmarchn (talkcontribs)

With a wiki with the Translate extension installed, how I can add a dialect?. For example, based on the Spanish (es) to create a version for the Mexican variant (es-mx)?.

Nemo bis (talkcontribs)
Jmarchn (talkcontribs)

@Nemo bis:

I added

$wgExtraLanguageNames['es-mx'] = 'mexican spanish';
or
$wgExtraLanguageNames['es-mx'] = 'Español (México)';

Also

1. I added several files:

  • ..\extensions\UniversalLanguageSelector\i18n\es-mx.json
  • ..\extensions\UniversalLanguageSelector\lib\jquery.uls\i18n\es-mx.json
  • ..\languages\classes\LanguageEs_mx.php
  • ..\languages\i18n\es-mx.json
  • ..\languages\messages\MessagesEs_mx.php
  • ..\languages\data\plurals.xml

2. And update:

  • ..\languages\data\plurals.xml
  • ..\languages\Names.php

3. I can't modify langnames.ser (it is a non-text file), but it already contains 'es-mx' as 'mexican spanish' (an other names for 'es-mx').

BUT:

  • In Language selector mexican spanish or Español (México) doesn't appears. How do I solve it?. It is possible access to mexican from URL with ...?setlang=es-mx.
  • Since my wiki (ophtalmological advices for patients) is set to $wgLanguageCode = "en";, I would like:
  1. Now on selecting mexican spanish all the messages appear in English (if then aren't translated). Since only a few messages (in Mexican language) should be different of Spanish language, I wish messages appear in Spanish (non-Mexico) when the messages are not translated. It is possible?.
  2. On translation to Mexican it would be advisable appear a suggestion from Spanish translation. It is possible?.
Nemo bis (talkcontribs)

There is no need to alter so many files. Beyond $wgExtraLanguageNames, you only need language fallbacks (in MessagesEs_mx.php). For ULS, the files is langdb in https://github.com/wikimedia/jquery.uls, or you cna hack directly jquery.uls/src/jquery.uls.data.js

This supersedes all your other points.

As for your point BUT(2), see assistant languages.

Jmarchn (talkcontribs)

Very thanks!

I suppose point 1. are no solution...

Nemo bis (talkcontribs)

As I said, point BUT(1) is solved by fallback language.

Jmarchn (talkcontribs)

@Nemo bis:

Now I only have:

  1. ../languages/classes/LanguageEs_mx.php
  2. ../languages/messages/MessagesEs_mx.php
  3. ../extensions/UniversalLanguageSelector/lib/jquery.uls/src/jquery.uls.data.js (added es-mx..., then runs correctly, español (México) is displayed).

with code for 1 and 2:

<?php
$fallback = 'es';

But in the pages in Mexican Spanish (when español (México) is selected) not appear the messages in Spanish, only they appear in English (if they are not translated to Mexican Spanish).


Very thanks!

Reply to "Add a dialect"