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

Localization problem time string change locale without config. #10

Open
giver opened this issue Feb 17, 2014 · 8 comments
Open

Localization problem time string change locale without config. #10

giver opened this issue Feb 17, 2014 · 8 comments

Comments

@giver
Copy link

giver commented Feb 17, 2014

Before update to 0.3.0, I think my locale default with 'en' but after update to 0.3.0 my locale was automatic change to 'de' (I notice by the string it was produced). I don't know why. Because I never touch the localization setting in my app before.

@yannickl
Copy link
Owner

Indeed, it is weird. I fixed some issues with the localized strings in the last version (0.4.1). Can you try with this version?
Otherwise, have you tried to print the [[NSBundle mainBundle] preferredLocalizations]?

@giver
Copy link
Author

giver commented Feb 18, 2014

@yannickl Sorry my fault, I tell you the wrong version. Currently, I use YLMoment (0.4.0). I install it via Cocoapods

Before:
YLMoment (0.3.0) -- No problem
After:
YLMoment (0.4.0) -- Problem here

[[NSBundle mainBundle] preferredLocalizations] // --> en

@yannickl
Copy link
Owner

@giver Are you using Cocoapods or have you installed the library manually?

What happens if you manually set the locale? E.g. [[YLMoment proxy] setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US"]];?

@giver
Copy link
Author

giver commented Feb 24, 2014

@yannickl

Not working

[[YLMoment proxy] setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US"]];
YLMoment *moment = [YLMoment momentWithDateAsString:time format:@"yyyy-MM-dd'T'HH:mm:ssZZZZZ"];
_timeLabel.text = [moment fromNow];

Working code (I must specific locale)

YLMoment *moment = [YLMoment momentWithDateAsString:time format:@"yyyy-MM-dd'T'HH:mm:ssZZZZZ" localeIdentifier:@"en_US"];

@yannickl
Copy link
Owner

@giver I'll do some test tonight to see if I can find the prob.

yannickl added a commit that referenced this issue Feb 24, 2014
@yannickl
Copy link
Owner

@giver I updated the code. Can you tell me if everything is ok now please?

@giver
Copy link
Author

giver commented Feb 27, 2014

@yannickl It doesn't work. I'm not sure if there is some code or environment configuration that make the things mess up.

@yannickl
Copy link
Owner

@giver Very strange, the test on my local configuration works. Is it possible to have a sample project which reproduce the issue?

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

No branches or pull requests

2 participants