Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Use language files for multilingual apps #649

Closed
9 tasks done
scriptPilot opened this issue Aug 30, 2017 · 0 comments
Closed
9 tasks done

Use language files for multilingual apps #649

scriptPilot opened this issue Aug 30, 2017 · 0 comments

Comments

@scriptPilot
Copy link
Owner

scriptPilot commented Aug 30, 2017

Store language patterns in json files

/lang/en.json

{
  "emailSubject": "Greetings from Hamburg",
  "emailBody": "Hello {{username}}!"
}

/lang/de.json

{
  "emailSubject": "Grüße aus Hamburg",
  "emailBody": "Hallo {{username}}!"
}

Use language pattern

Template

{{$lang('emailSubject')}}
{{$lang('emailBody', {username: 'Bugs Bunny'})

Script:

this.$lang('emailSubject')
this.$lang('emailBody', {username: 'Bugs Bunny'})

Configuration

  • Default language: "defaultLanguage": "en"
  • Fallback: "defaultLanguageFallback": false

Check on any build command

  • All language files valid
  • Default language file found
  • Sort language files content by item
  • Check if all language files are flat key:string pairs
  • All language files have same items as the default one (if fallback is false)
  • All language files have not more items as the default one

In addition

  • Create folder on installation
  • Update documentation
  • Update folder structure documentation
@scriptPilot scriptPilot changed the title Improve multilingual apps Use language files for multilingual apps Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant