Page MenuHomePhabricator

Add CeJS to translatewiki.net
Closed, ResolvedPublic

Description

Project information

Name: CeJS
Homepage: https://github.com/kanasimi/CeJS
Project link: https://github.com/kanasimi/CeJS
Code repository: https://github.com/kanasimi/CeJS

  • Source branch: master
  • Target branch: master

License: BSD
Issue Tracker: https://github.com/kanasimi/CeJS/issues
Project contact: https://translatewiki.net/wiki/User:Kanashimi

Logo:

  • Without text: none
  • With text:

Project description:

NOTE: wikiapi and wikibot are both depend on CeJS, so we are planning to translate it instead.

A simple way to access MediaWiki API via JavaScript with wikitext parser. This is basically a modern syntax version of CeJS MediaWiki module. For example, using async functions.

Hi, friends. I am the maintainer of library wikiapi and bot wikibot for 7 years. The library is used to access MediaWiki projects, and the bot is running on 12+1 projects (including outstation) till now. Since I am not good at non-native languages, and my bot need to run on different languages (including en, js, zh, ks till now), recently I find it is harder to maintain the translation. I use a translation module like this: https://ks.wikipedia.org/wiki/%D8%B1%D9%8F%DA%A9%D9%8F%D9%86:Cewbot/log/20150916/configuration#L10n . But that's obviously not a good idea. I was interesting in let the projects joining to the translatewiki but do not know how. Nike tells me to go to here. If there is anything wrong please let me know. Please help me to add the project to translatewiki, thank you.

NOTE: Section below will be filled by twn staff

Project setup checklist

Project configuration (for translation admins)

Namespace: NS_WIKIMEDIA
Prefix: cejs-
Validators: Insertable Regex
Support: https://github.com/kanasimi/CeJS/issues

Concerns

  • Should we commit translations to the master branch?
  • What is the license for CeJS?
  • How are the JSON translations used in the project?

Details

Related Changes in Gerrit:

Related Objects

Event Timeline

Kanashimi updated the task description. (Show Details)

Hi @Kanashimi

Thanks for your interest in adding the project to translatewiki.net

I reviewed the code at https://github.com/kanasimi/wikiapi and I was not able to see any strings that needed localisation. I assume that the bot uses the strings present here: https://ks.wikipedia.org/wiki/%D8%B1%D9%8F%DA%A9%D9%8F%D9%86:Cewbot/log/20150916/configuration#L10n as a source?

To integrate the project in translatewiki, the messages will have to be added to the source code repository in GitHub. Translatewiki will read the strings from there (import), and then when translators translate these strings on translatewiki, it will export them out back to the source code repository. The code for the bot will have to be update to use the appropriate language based on the wiki or source page language.

Lets take the example of InternetArchiveBot. All the translations for the bot are present here: https://github.com/internetarchive/internetarchivebot/tree/master/app/src/html/i18n, the source language being en.json. Other languages have their own files: French - fr.json, Bangla - bn.json etc. These are then used by the bot as needed, see strings present in {{}}: https://github.com/internetarchive/internetarchivebot/blob/747a88abb3a92281804f001476a670f1e8ca37a2/app/src/html/Templates/main.html#L68

Oh, thank you for reminding. I just update the i18n data, you may find it https://github.com/kanasimi/wikiapi/tree/master/i18n .

I must say, it is copy from https://github.com/kanasimi/CeJS/tree/master/application/locale/resources/i18n since I had ask Nike to make CeJS join translatewiki at 2016 and he told me to do this first. wikiapi and wikibot are both depend on CeJS.

Are there any more thing I should do? Please tell me, thank you.

If both wikiapi and wikibot are dependent on CeJS and they use the same messages, should we just look at adding that instead of both these projects? If we translate CeJS, then I assume that these two projects would automatically use those translations?

Yes. This seems more reasonable. :)

So how are these JSON localization files used in the code? Is there a build process in places to convert these JSON files into CSV or something else so that the code can then use it?

Additionally please see the concerns I've added in the task description.

abi_ renamed this task from Add wikiapi and wikibot to translatewiki.net to Add CeJS to translatewiki.net.Feb 1 2022, 6:42 AM
abi_ updated the task description. (Show Details)
abi_ updated the task description. (Show Details)

Should we commit translations to the master branch?

Yes, I expected translatewiki to commit to https://github.com/kanasimi/CeJS/tree/master/application/locale/resources/i18n
Or do we have any other way to update?

What is the license for CeJS?

BSD

How are the JSON translations used in the project?

The JSON file will be converted to ja file under https://github.com/kanasimi/CeJS/tree/master/application/locale/resources , and will be used like this:

gettext("'''Stopped''', give up editing.");

gettext('First, use %1 to get %2 pages.', time, pages);

The function gettext() is defined in https://github.com/kanasimi/CeJS/blob/master/application/locale.js

Or do we have any other way to update?

We could also commit to another branch and create a PR to the master / main branch.

Also please provide access to the translatewiki bot to commit changes the master branch.

Change 759208 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[translatewiki@master] Add CeJS

https://gerrit.wikimedia.org/r/759208

Also please provide access to the translatewiki bot to commit changes the master branch.

Thank you! I have add the translatewiki as a collaborator.

Since the translatewiki bot will not collect configurations from the branch, if I want to add new statements, or modify existed statements, I need to change it on translatewiki. Is my understanding correct? Is there a way to add new statements by programming method, or by committing changes to the master branch?

abi_ changed the task status from Open to In Progress.Feb 3 2022, 12:14 PM
abi_ claimed this task.
abi_ triaged this task as Medium priority.
abi_ updated the task description. (Show Details)

Since the translatewiki bot will not collect configurations from the branch, if I want to add new statements, or modify existed statements, I need to change it on translatewiki. Is my understanding correct? Is there a way to add new statements by programming method, or by committing changes to the master branch?

If you have to add a new string or update existing ones, please change them for the source language that is en.json in the project repository and update the corresponding message documentation in qqq.json. Translatewiki will then import these strings.

The translations to various languages should be done on translatewiki.

Thank you. I will practice this method.

Change 759208 merged by jenkins-bot:

[translatewiki@master] Add CeJS

https://gerrit.wikimedia.org/r/759208

@abi_ Hi. I find that https://gerrit.wikimedia.org/r/c/translatewiki/+/760557 says the file is not using utf-8. I can change the encoding. Should I do this?

@abi_ Hi. I find that https://gerrit.wikimedia.org/r/c/translatewiki/+/760557 says the file is not using utf-8. I can change the encoding. Should I do this?

Yes, that would fix the problem. Adding support for utf-16 on our side would be more time taking.

The project is now available for translation. Translation exports will happen tomorrow.