Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-993

i18n allow translations in template views to use keys without prefix

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.0.0.Beta7
    • Component/s: ErraiUI
    • Labels:
      None
    • Release Notes Text:
      Errai i18n now supports unprefixed keys. At runtime, keys are resolved by first checking for a prefixed key in the given locale, and only if that is not found checking for an unprefixed key.

      Description

      Currently, data-i18n-prefix is set in templated views, forcing that each translation key to be composed by viewname.key. Problem is that in some cases it can cause keys to be duplicated across different views and translation service. See example below for a common key:

      close=Close
      view1.close=Close
      view2.close=Close

      Ideally, we should be able to share the same key (close) across the different views and translationservice.format.

      It could be that the translation at the template levels would look for prefix at data-i18n-prefix but fallback to no prefix in case that is not found.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                cristiano.nicolai Cristiano Nicolai
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: