Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-825

Ability to Keep Language Packs in Sync

    XMLWordPrintable

    Details

    • Additional information:
      Hide

      [B]ORIGINAL IDEA (replaced with new in May-2012)[/B]

      Here is some ideas how we can keep language packs from multiple languages synchronized with primary language pack for English language.

      We invent such term as translatable unit. Units could consist of one or more fields (textareas) that could be translated. Also translatable unit will feature a Description field, that will tell translator, where exactly given text will be used, so translation could be more accurate and appropriate. Each translatable unit have unique identifier (phrase name for phrases and email event name + email event type for email events). Each translatable unit have version number (integer). Once primary language translation is updated or new translation unit is added, then it's version number is incremented.

      When we perform translation of set of the translatable units (language pack) to other language, then each unit will keep it's version, version used to make initial translation). When primary unit translation (on English language) will be changed, then it's version number will changed and will differ from all other translated units in other language packs. This way we can detect translation units, that need to be updated to be in sync.

      I suppose, that this will be some script on http://www.in-portal.com website. Each website user can register as "translator" for any count of languages so he'll get notified when his expertise is need to keep associated language pack in sync. Page with language packs will be automatically constructed based on finished translation for each language pack and translation progress bar will available for each language pack.

      I'll try to look if something, that I've described is already available on the Internet, if not will write something myself.

      Here is how Drupal does that: [url]http://localize.drupal.org/translate?no_cache=1265705125[/url].

      We can expand this idea to site upgrade so we will track what phrases, email events user have changed and what of there were changed on original language pack in new version of In-Portal and overwrite only not touched by the user.

      Show
      [B] ORIGINAL IDEA (replaced with new in May-2012) [/B] Here is some ideas how we can keep language packs from multiple languages synchronized with primary language pack for English language. We invent such term as translatable unit. Units could consist of one or more fields (textareas) that could be translated. Also translatable unit will feature a Description field, that will tell translator, where exactly given text will be used, so translation could be more accurate and appropriate. Each translatable unit have unique identifier (phrase name for phrases and email event name + email event type for email events). Each translatable unit have version number (integer). Once primary language translation is updated or new translation unit is added, then it's version number is incremented. When we perform translation of set of the translatable units (language pack) to other language, then each unit will keep it's version, version used to make initial translation). When primary unit translation (on English language) will be changed, then it's version number will changed and will differ from all other translated units in other language packs. This way we can detect translation units, that need to be updated to be in sync. I suppose, that this will be some script on http://www.in-portal.com website. Each website user can register as "translator" for any count of languages so he'll get notified when his expertise is need to keep associated language pack in sync. Page with language packs will be automatically constructed based on finished translation for each language pack and translation progress bar will available for each language pack. I'll try to look if something, that I've described is already available on the Internet, if not will write something myself. Here is how Drupal does that: [url] http://localize.drupal.org/translate?no_cache=1265705125[/url]. We can expand this idea to site upgrade so we will track what phrases, email events user have changed and what of there were changed on original language pack in new version of In-Portal and overwrite only not touched by the user.
    • Change Log Group:
      Added
    • Change Log Message:
      Allow tracking translation status (up to date or not) between language packs.
    • Story Points:
      2
    • External issue ID:
      1023
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

    • BC Break Details:
      Hide

      Reborn constants:

      • "LANG_OVERWRITE_EXISTING" and "LANG_SKIP_EXISTING" into "LanguageImportHelper::OVERWRITE_EXISTING"

      Properties renamed:

      • "LanguageImportHelper::$import_mode" into "LanguageImportHelper::$_importOptions"

      Method signature changed:

      • "LanguageImportHelper::performImport" method "$import_mode" parameter was removed in favor of "LanguageImportHelper::setOption" added method

      Solution

      1. restore declaration of LANG_OVERWRITE_EXISTING and LANG_SKIP_EXISTING constants
      2. add these tags in DocBlock of restored constants:
        • @deprecated
        • @see LanguageImportHelper::setOption()
      3. restore "$import_mode" parameter of "LanguageImportHelper::performImport" method:
        • when parameter is used trigger a deprecation notice
        • when parameter is used internally call "setOption" method to get desired effect
      Show
      Reborn constants: "LANG_OVERWRITE_EXISTING" and "LANG_SKIP_EXISTING" into "LanguageImportHelper::OVERWRITE_EXISTING" Properties renamed: "LanguageImportHelper::$import_mode" into "LanguageImportHelper::$_importOptions" Method signature changed: "LanguageImportHelper::performImport" method "$import_mode" parameter was removed in favor of "LanguageImportHelper::setOption" added method Solution restore declaration of LANG_OVERWRITE_EXISTING and LANG_SKIP_EXISTING constants add these tags in DocBlock of restored constants: @deprecated @see LanguageImportHelper::setOption() restore "$import_mode" parameter of "LanguageImportHelper::performImport" method: when parameter is used trigger a deprecation notice when parameter is used internally call "setOption" method to get desired effect

      Description

      [B]1. Tracking Changes[/B]

      I've imagined that such (or alike) translation system would also be useful for In-Portal websites, who are translated into multiple languages to keep all phrases/e-mails in sync between languages.

      a. Add "TranslateFrom" ML column into LanguageLabels (former "Phrases") and EmailEvents (former "Events") database tables
      b. Add "Use as Primary" button on phrase/e-mail event edit page (with hint "Use this translation as primary for other languages")
      Initially all TranslateFrom columns have 0 in them, that means - "I'm in sync".
      c. As you probably noticed user then can press either "Save" or "Use as Primary" button after changing a translation on a specific language he is assigned to translate.

      Pressing "Use as Primary" would save phrase/e-mail event translation and set this language ID to TranslateFrom field for all other languages except current one:
      l1_TranslateFrom = 3
      l2_TranslateFrom = 3
      l3_TranslateFrom = 0
      l4_TranslateFrom = 3
      l5_TranslateFrom = 3
      In example above you can easily see, that translation was changed on 3rd language and all other languages needs to be updated to be in sync.

      Pressing "Save" would set 0 to TranslateFrom column at current language only, like in example below:
      l1_TranslateFrom = 3
      l2_TranslateFrom = 3
      l3_TranslateFrom = 0
      l4_TranslateFrom = 3
      l5_TranslateFrom = 0
      Here 5th language translation was fixed to be in sync and 0 was set in corresponding field.

      Then in phrase/e-mail event list we create column "Translation in Sync" (Yes/No), where we would just compare TranslateFrom column from current language with 0. If it's 0, then all is translated.

      On phrase editing page we'll show translation form language indicated in TranslateFrom column and not from primary language. Of course if TranslateFrom = 0, then we can fallback to translation from primary language.

      Also I've noticed that we're not showing translation from primary language on e-mail event editing, which makes it harder to translate them.

      [B]2. Sync Status in %[/B]

      Propose another grid column in Regional Configuration menu, called "sync status", where we could display % of
      synced labels, for reporting purposes.

      SUM(IF(l5_TranslateFrom = 0, 0, 1)) / COUNT(l5_TranslateFrom).

      SUM(IF(l5_TranslateFrom = 0, 1, 0)) - phrase count, that doesn't require to be synced
      COUNT(l5_TranslateFrom) - total phrase count

      In total we'll have following Sync columns:

      • "Front-End / Both Labels"
      • "Admin Labels"
      • "Front-End E-mail Events"
      • "Admin E-mail Events"

      [B]3. Percentages of Content Block Translation[/B]

      Create a "Scheduled Task" (former "Agent"), that would count % of translated content blocks for each page, which has them. It of course won't allow to track outdated translations as with phrases, but it at least would tell what content blocks aren't translated at all on other languages.

      Add multilingual (one column per language) TranslatedContentBlocks column to Categories database table. For each language execute this SQL to fill it:

      SELECT SUM( IF(COALESCE(l1_Content, '') = '', 0, 1) ), PageId
      FROM PageContent
      GROUP BY PageId

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
                Reviewer:
                Gleb Sinkovskiy [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: