Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Appsemble Appsemble
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 100
    • Issues 100
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Appsemble
  • AppsembleAppsemble
  • Issues
  • #158
Closed
Open
Created Apr 10, 2019 by Wessel Kuipers@wesselkuipers🐕Owner14 of 15 tasks completed14/15 tasks

Internationalize apps

Description

Apps should be internationalized. A big part of this is translations.

Our remappers provide a simple entry point to get started with this. We should encourage all block developers to make user facing texts remappers. They may use a hard coded string to provide English as a last fallback.

Some user facing texts aren’t part of a block, e.g. page titles and block titles. These texts should also be transformed into remappers. These can be targeted by specifying the path in the app definition to the content to translate.

app.yaml

primaryLanguage: en # implied/default

pages:
  - name: Foo # Foo is the title for the primary language.
    blocks:
      - parameters:
          myLabel:
            - string.format:
                messageId: myLabel
                values:
                  foo: Test

messages/en.yaml

myLabel: This is my label {foo} # This is my label Test

# autogenerated/available by default
appsemble:pages.0: Translated Page Name

When uploading languages for an app, the app has an directory named messages. The messages directory contains YAML files named <lang-code>.yaml. These will be uploaded to the translations API when uploading the app.

apps/
 └─ waarnemingen/
     ├─ app.yaml
     └─ messages/
         ├─ en.yaml
         ├─ en-GB.yaml
         ├─ en-US.yaml
         └─ nl-NL.yaml

Requirements

  • Redirect user to appropriate language path (/en-us/page-name)
  • Option to set fallback/primary language for app
    • Check if language name is valid
  • Add messageId to message.format (alternatively, introduce a message remapper)
  • Database table to store translations (AppId, language, content)
  • API endpoint for getting translations
  • API endpoint for setting translations
  • Page name translations
    • Adjust defaultPage to work with this
  • Display warnings/check usage of translation message IDs
  • Set preferred language on user profile (order of preference) #417 (closed)
  • Fall back to {messageId} if no translation can be found #414 (closed)
  • Show warning if no translations can be found on save
    • Merge with base language (nl with nl-NL and nl-BE)
  • When cloning a translated app, translations should be cloned too #415 (closed)
Edited Aug 28, 2020 by Wessel Kuipers
Assignee
Assign to
Time tracking