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

String.L10n() is not working #8

Closed
a-v-ebrahimi opened this issue Oct 30, 2017 · 3 comments
Closed

String.L10n() is not working #8

a-v-ebrahimi opened this issue Oct 30, 2017 · 3 comments
Labels

Comments

@a-v-ebrahimi
Copy link

I added a Localizable.strings with 3 languages into project and included it in build phase.
This is english version of it:

/*
 strings.strings
 NavigationDrawerController
 
 Created by A.V.Ebrahimi on 4/21/17.
 Copyright © 2017 CosmicMind. All rights reserved.
 */
"AppName" = "Mallowin";

But now this is not working :
toolbar.title="AppName".l10n()

@Decybel07
Copy link
Owner

You added Localizable.strings but in file's header you have strings.strings. Can you check the file name?

@dfmarulanda
Copy link

dfmarulanda commented Dec 28, 2018

I have the exact same problem:

/* 
  Localization.strings
  Crowdswap

  Created by Daniel Marulanda on 12/28/18.
  Copyright © 2018 Crowdswap, Inc. All rights reserved.
*/

"waiting" = "Waiting for a swap since";
"candidate" = "We found a swap";
"done" = "Swap was completed";
"get" = "Get";
"giving" = "giving";

Then i just use
"candidate".l10n()
but nothing happens and the app just add the "candidate" string to my label.

My Localization.strings file is included in the compile source; there is another step im missing?

@Decybel07
Copy link
Owner

Decybel07 commented Dec 29, 2018

The default name for the translation file is Localizable.* (Localizable.strings, Localizable.json, etc). If you want to use a different name then you have to add the resource parameter:
"candidate".l10n(resource: "Localization")

@Decybel07 Decybel07 pinned this issue Dec 29, 2018
@Decybel07 Decybel07 unpinned this issue Jul 17, 2019
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

3 participants