I18nEdit

I18nEdit is a translations editor for translations compatible with the translation format used by I18n-js and its Scribunto implementation. It was made primarily for editing translations on , but could most likely be used on any other wiki as well. Its interface is located at Special:BlankPage/I18nEdit.
== ==
The translation interface is divided into several pages:
* The translation listing at Special:BlankPage/I18nEdit, which lets you search for scripts or modules to translate, either by name or by languages where translations are missing, outdated or incomplete (more on the meaning of these below).
* The language picker at Special:BlankPage/I18nEdit/SCRIPT (or Special:BlankPage/I18nEdit/Lua/MODULE), which lets you pick languages to translate a script or module into after picking the script or module to translate.
* The translator at Special:BlankPage/I18nEdit/SCRIPT/LANGUAGE (or Special:BlankPage/I18nEdit/Lua/MODULE/LANGUAGE), which lets you translate the messages in the selected script or module to the selected language.
** This interface is also used for managing English messages, message descriptions and metadata, can be reached from the language picker screen and adds buttons for adding messages, removing messages, marking messages as untranslatable and deciding what happens to changed messages after saving translations.
* The creator at Special:BlankPage/I18nEdit/create (or Special:BlankPage/I18nEdit/Lua/create), which lets you set up a new translation for a script or module, and, if you already have JSON for your translation, it can validate that JSON and use it as a starting point.
Navigating between each of these pages, once you've loaded one of them, can be done without reloading the page. Linking to them using wikilinks is also possible, for example, you can link to the page for translating the editor's interface from German into Russian.
The following terminology is used for translations:
* Missing: when there is no translation to a certain language
* Incomplete: when there is a translation to a certain language, but it's missing certain messages
* Outdated: when there is a translation to a certain language, but since it was translated, the English messages were edited and the author decided to mark these changed messages as outdated
=== Translation search ===
The translation search screen has several components, as marked on the screenshots above in the following order:
# Filter: You can use this to filter scripts or modules either by name or by language. When filtering by name, only scripts which contain the entered text will appear in the list below. When filtering by language, only scripts or modules whose translations to selected languages are missing, incomplete or outdated.
# Page list: Scripts or modules that were filtered by the filter above appear here. Upon clicking one you switch to the language picker page. There is also additional data about the reasons why they are listed there.
# Edit dropdown: You can enter the translation creator from the main edit dropdown button, and switch between translating JavaScript scripts and Lua modules using a button within the dropdown.
=== Language picker ===
The language picker's components are the following:
# Translating from: You can pick the reference language to translate from from the dropdown on the left side of the screen, which will make reference messages in the editor to appear in that language. Only languages whose translations are not missing, incomplete or outdated are listed in this dropdown.
# Language filter: Typing language names or codes into the language filter makes them appear at the top of the list. It is also the only way to reach languages whose translations are missing, and the preferred way of navigating through the list of languages.
# Language list: Filtered languages will appear in the language list. Languages that the script has already been translated to will always appear in the list, but the filter may determine whether they show up higher or lower in the list. Upon clicking on a language, it will be selected and the Edit button will be enabled. You can select multiple languages from this list.
# Edit dropdown: You can enter the translator from the main edit dropdown button, if you have selected a language to translate to. You can also enter the message manager interface from this dropdown.
=== Translator ===
The translator consists of the following:
# Message list: Here is where all translatable messages are listed. When selecting a message, the right pane updates with contents that let you translate that message. Messages are listed in the language you are translating from, and next to them are indicators of their translation status. A cross icon (❌) indicates the message has not yet been translated into all selected languages, a warning sign icon (⚠️) indicates the message is outdated in certain languages, and a checkmark icon (✅) indicates the message has been translated properly. When there are no messages in a translation (for example, when you just entered the translator from the creator) here will be a button for adding a new message. When hovering over the message text in the list, you can see its message code.
# Context header: You can view the reference language translation (in the screenshot, since the messages are being translated from Spanish, that message is in Spanish) as well as the description of that message, if any were provided during translation management or creation.
# Translations: Here are the boxes where you input your translations for each language. Sections for each language are collapsible. After a translation textbox loses focus, the draft of that translation will be saved and right pane's indicator will update accordingly.
# Toolbar: various buttons for working with your translations:
#* Save: Prompts you for an edit summary, saves the translations you have made and returns to the language picker.
#* Next: Changes to the next message. This button was introduced so our tab friends can more easily do all their work on this screen using only their keyboard.
#* Discard: Discards your current translation draft. It is recommended that you discard your drafts if you don't intend to save them before moving to other translations, since they will free up your draft storage and if the translations have changed since you last translated them you won't come back to your old translations.
==== Message management ====
The message management page, which you can reach from the edit dropdown in the language picker, is pretty much the same as the regular translator page except that you can change English translations and message descriptions. The toolbar also has some new buttons:
* Add message: Prompts you for the message code, then adds a new message to translate.
* Remove message: After confirmation, removes the currently selected message from the translation.
* Message future dropdown: The option selected here decides what will happen to messages whose English translation was changed after saving translations.
** Mark messages as outdated on save: Probably the preferred option, this marks previously translated messages as outdated.
** Remove changed messages: Removes previously translated messages. You should probably select this option if the strings you changed greatly changed their meaning.
** Do nothing: Does not do anything with previous translations. Useful when simply fixing English wording that may not affect other languages.
* Do not translate: Marks the current message as untranslatable. When marked as untranslatable, the message won't appear in the message list when not managing translations.
The original English message in the context area has also been replaced with the message's code (as the English message is already in the textbox).
=== Creator ===
The creator is divided into three steps of creation.
# Translation name: You first need to enter the name of your translation and the creator will check whether that name already exists on Dev.
# JSON import: You do not need to input anything in this field, if you do not have existent translations to import. However, if you do, clicking on the button for checking your JSON input is going to make sure your JSON is I18n-js-compatible, report errors if it will cause the editor or the library to malfunction, or warnings if it won't cause either to malfunction but may not be what you really wanted to import.
# Enter translator: This last step makes sure you have successfully went through the first two and directs you to the translator screen, which will be empty if you haven't imported any translations. From there you can add and modify your translations, and upon saving your translation will be created. If you discard your translations and leave the page, you will have to go through the creator again.
== ==
== Notes ==
* The editor may be listing all languages which have been translated to in the language picker page, but it should only allow translating to supported languages. During the switch to the UCP, many languages which were previously available on Fandom can no longer be selected in preferences, so users likely won't be seeing translations in these languages and the editor should not list these as options when they won't actually appear anywhere.
* The new translations format for Lua i18n modules assumes there will be no comments in the module. Comments relating to messages should appear in message descriptions, whereas comments relating to the page itself can go to the module documentation page for that module.
* On , we use an additional script for showing a notice on JSON pages about how the translations editor should be used for editing the translations, as well as a template for showing that on Lua documentation pages of these modules.
== Future updates ==
: This section is not translated to other languages as it may update more often.
The list here serves as a log of features which have been suggested and may be implemented in one of the future versions of the editor. If you want to suggest a feature, you can do so on the talkpage.
* Messages in the language picker are sorted by language code, but no language code is displayed in list items. This is best resolved by putting the language code in list items.
* Linking back to the documentation and translation page somewhere from the editor.
* Remembering the user's selected languages on the translation selection screen and placing them on top of the language list when no filter has been placed.
* A credits screen showing which user contributed to translations in which language available from the language picker edit dropdown.
* Allow exporting translations for offline translation and later importing, for example, as .po files.
* Add more metadata about how are certain messages actually used, for example, the information about which messages are passed through .parse() tells translators whether they can use a subset of HTML and wikitext in these messages, as well as magic words like {{PLURAL:}}
* Using the centralized page for supported languages instead of the hardcoded list of languages.
* Message descriptions:
** Report of scripts with missing message descriptions.
** More specialized handling of message descriptions - the interface can provide a way to more easily describe message parameters, which can then be serialized in a way that is machine readable. This also allows us to display the meaning of parameters better and warn translators when they haven't used a certain parameter, or when they have used a nonexistent parameter.
** When displaying message descriptions, links and formatting should probably be parsed and displayed like that.
* Drafts:
** Saving drafts can exceed the local storage quota and cause errors if the user has not discarded a great amount of their previous drafts. These errors should be handled gracefully, with a banner reporting the error to the user once per session and a button to discard all previous drafts.
** Allowing the user to somehow find which translations have they left unsaved drafts on.