https://bugzilla.wikimedia.org/show_bug.cgi?id=38381

       Web browser: ---
             Bug #: 38381
           Summary: i18n "int-hack" does not work very well in
                    JavaScript....
           Product: MediaWiki
           Version: 1.20-git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: JavaScript
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: mtrac...@member.fsf.org
                CC: krinklem...@gmail.com, tpars...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---


Background:
http://www.mediawiki.org/wiki/Localisation#Messages_quoting_each_other

I have the following message in an i18n file:

'ethereditor-warn-others' => 'Warning: Some other users are currently editing
this page in a collaborative session using the EtherEditor extension. While you
are welcome to keep editing here, their changes may conflict with yours. Please
consider clicking the "{{int:ethereditor-collaborate-button}}" button in the
top right of the page screen to join them, and avoid merge conflicts.'

This is a great thing and all, since I don't want people to need to update this
message if the ethereditor-collaborate-button message gets changed. OK, good
stuff.

However, the JavaScript message object has two huge problems with this:

1. The JS message object doesn't even glance at the {{int:....}} part, just
leaves it.
2. Even if it did look at it, I never included 'ethereditor-collaborate-button'
in the required messages for this module, so there would be exactly no way for
the library to sanely handle the int-hack method.

So, possible solutions:

1. Compile the int-hack bits of the message on the server before it gets sent
to the client. This isn't ideal, since the client couldn't modify the message
if necessary (for example, I use a message in the same extension to generate a
regular expression).
2. Auto-include the int-hacked messages (in this case,
ethereditor-collaborate-button) in the resource loader's loaded messages, and
then consider {{int:}} parts of a message while parsing. This would take some
doing, but it's possible. Also, a potential problem (and this is perhaps a
consideration for the entire l10n system, not just client-side) is that {{int}}
is a valid template on some wikis. I'm not sure if that's important, maybe if
the parser looks for {{int:<something>}}, there won't be overlap with
{{int|something}}.

Thanks!

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to