Page MenuHomePhabricator

Epic: Create a Python port of the Intuition i18n library
Closed, DeclinedPublic

Description

Per T112307, we should create a Python port of the Intuition i18n library so that more Tool Labs tools can have robust internationalization.

Code repo: https://github.com/Krinkle/intuition

Acceptance criteria:

  • Register domains by name and directory path.
  • Retrieve messages by key and language from the JSON files.
  • Automatically fallback to English for keys not yet translated.
  • TranslateWiki integration should be optional.

Try to keep the method names and parameters (function signatures) consistent between the PHP and Python implementations to provide users with a consistent API across both.

See T112307 for further discussion.

Event Timeline

kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added a project: Community-Tech.
kaldari subscribed.
kaldari renamed this task from Epic: Create a Python port of the Intuition i18n library to Create a Python port of the Intuition i18n library.Oct 21 2015, 4:38 PM
kaldari moved this task from New & TBD Tickets to Older: Team Work on the Community-Tech board.
kaldari set Security to None.
  • TranslateWiki integration should be optional
  • language fallbacks should be customizable

@Ricordisamoa: I'll go ahead and put "TranslateWiki integration should be optional" into the Acceptance criteria. For the other features, we'll want to make follow-up tasks I think.

kaldari renamed this task from Create a Python port of the Intuition i18n library to Epic: Create a Python port of the Intuition i18n library.Oct 23 2015, 5:41 PM
kaldari updated the task description. (Show Details)

Assessment for prioritization:
Support: Medium/High
Feasibility: Medium/Difficult (won't be trivial to implement)
Impact: High
Risk: Medium

Priority: Normal

kaldari triaged this task as Medium priority.Oct 23 2015, 6:20 PM

If by "translatewiki.net integration" you mean the ability to for them to pull and push updates, then this requirement is redundant with "Retrieve messages by key and language from the JSON files".

The "Banana" file format that Intuition uses is the same that translatewiki uses.

Perhaps not in the first iteration, but I've got a few other suggestions for features needed for the implementation to be good enough for end users in majority of tools:

  • Support fallback chain (not just from target to English, but include intermediary language as well. This is important in order to support languages that only override a few messages and is expected by those that author the translations).
  • Message variables. (expand $1 and $2 placeholders)
  • Message language functions. (transform {{PLURAL:}})
  • Map language code to directionality (e.g. getDir() "ltr" or "rtl" - required to produce HTML output that doesn't render in an unreadable way for RTL users).

@TBolliger: This task is open but not associated to any active project/tag. Could you please fix that? Thanks.

Niharika subscribed.

This task was opened before the wishlist came into being. This would be really great to have for a lot of tools and we might come back to work on it when we take on a project that will require this.