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

Treat empty string as valid translations (at least conditionally) #231

Closed
DethAriel opened this issue Sep 8, 2016 · 2 comments · Fixed by #261
Closed

Treat empty string as valid translations (at least conditionally) #231

DethAriel opened this issue Sep 8, 2016 · 2 comments · Fixed by #261

Comments

@DethAriel
Copy link
Contributor

I'm submitting a ...

[x] bug report

Current behavior
If translation yields empty string, the translation is considered missing.

Expected/desired behavior
Empty strings, should either be considered valid translations always, or with a conditional switch, like

translateService.tolerateEmptyStrings();

Reproduction of the problem
See this plunker

What is the motivation / use case for changing the behavior?
Use case is pretty much described in #223 . When localizing links, this is essential.

** Comments **
One could add a space there:

{
  "SOME_KEY": " "
}

but this is error-prone as such kinda redundant whitespace can be lost when localization team does its job.

Please tell us about your environment:

  • ng2-translate version: 2.4.3
  • Angular version: 2.0.0-rc.6
  • Browser: all
  • Language: all
@ocombe
Copy link
Member

ocombe commented Sep 8, 2016

You're right, empty string shouldn't be an error ! Sorry about that, I think it's a regression

@ngehlert
Copy link

ngehlert commented Apr 4, 2017

would you be willing to accept a PR that adds the suggested conditional switch?
I'd rather have empty values displayed with something like "[MISSING]: KEY" then just empty strings. At least this is the way I'm used to it with the old angular-gettext
@ocombe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants