Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Translation from a Translate function in an object support #77

Open
massar opened this issue Feb 10, 2017 · 1 comment
Open
Labels

Comments

@massar
Copy link
Member

massar commented Feb 10, 2017

The original TranslateObj function allowed an object to have a Translate function, thus keeping the translation function local to the object, and possibly allowing the translation to happen outside pitchfork.

6cc4175

This support has to be restored. The new GetTFunc should be renamed at minimum to GetTranslationFunc; it will serve as a cached translation func, instead of having to call i18n.Tfunc for every translation.

The TFunc can be attempted to be called when a per-object Translate function is not available.

Ctx->SetLanguage should not cause a panic when the given language does not exist.

We should be using bundles. Allowing multiple languages to be loaded at the same time from different json files and allowing errors to be detected which allows a fallback to another language.

@massar massar mentioned this issue Feb 10, 2017
@massar massar added this to the 1.5.1 Filtering Members by State milestone Feb 14, 2017
@massar
Copy link
Member Author

massar commented Feb 15, 2017

As expected:

2017/02/15 17:39:59 http: panic serving 127.0.0.1:62735: no supported languages found []string{""}

@massar massar added the bug label Feb 16, 2017
@bapril bapril removed this from the 1.5.1 Bug Attack milestone Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants