rokucommunity / rokucommunity/brighterscript

Provide compile checking for translations

Open
#64 0 comments 0 reactions 1 assignee View on GitHub

@chrisdp is already working on this.

Since May 1, 2020.

Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

This is a bit of a brain dump. I might tidy it up later.

The tr() function from Roku provides i18n functionality.

We should do the following:

  • add auto-completes for available strings in the translation files whenever you type tr()
  • parse all of the translation files
  • add a warning for any tr() call referencing a source that is not available in at least 1 localization file
  • add a warning for any <Label text="" /> tag that references a source
  • add a compiler option strictLocalization which does the stuff above.

We should be able to look it up in the file.

There are two ways this is handled
In the xml:

<Label id=“myLabel” text=“hello world” />

Roku will automatically replace "hello world" with the localized value IF there is a

Provide autocomplete for them.

Related information:
https://developer.roku.com/docs/developer-program/core-concepts/localization.md
https://developer.roku.com/docs/references/brightscript/language/global-utility-functions.md#trsource-as-string-as-string

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.