EddyVerbruggen / nativescript-i18n

This is a plugin for Nativescript that implements native i18n in an easy manner.
65 stars 30 forks source link

It is working for android but not for ios #68

Closed gtzinos closed 5 years ago

gtzinos commented 7 years ago

Hi, I am using your plugin for a month, and now its the first time i am trying to deploy my app for ios and the only plugin that is not working on ios its yours. This is my project structure

/app/i18n/en/strings.xml /app/i18n/el/strings.xml

I dont get any error/ warning in the console.

rborn commented 7 years ago

Hi, what is not working? I need more details to try to understand your issue, like logs, behaviour, etc.

ryanzaatari commented 7 years ago

Hi @gtzinos I think you placed it in the wrong folder, according to the documentation, it should be placed under App_Resources. (check the below screen shots from the actual documentation) It's weird that android picks it up though

screen shot 2017-08-31 at 11 12 20 pm screen shot 2017-08-31 at 11 12 34 pm

you have to change the default path if you want to keep it under App

screen shot 2017-08-31 at 11 16 15 pm

Hope this helps.

rborn commented 7 years ago

@gtzinos I pushed a new version with the last tns-core-module. Can you have a look and see if it fixes your issue?

Fusion commented 7 years ago

I have a similar issue, but not exactly, so apologies if this is hijacking.

I was not getting the labels to work at all, on either platform. It's like, with tns 3.2.0, something stopped working.

I worked around it by adding this to my models (example):

function AboutModel(info: {}) {
    var aboutInfo: AboutInfo = new Observable(info);
    // ...
    aboutInfo.L = (arg) => global.L(arg);
}

and, on Android, I can now see a "L()" function. On iOS, this does not seem to help.

To make me an even worse reporter, I am not able to debug the iOS version, even using simple console.log() calls because this part crashes on my Mac. So, yeah, feel free to take this with a giant pinch of salt.

Fusion commented 7 years ago

Additional thought, regarding @ryanzaatari 's comment: I believe you need to do something about that screenshot as everybody seems to misread it as "i18n under App_Resources" instead of "i18n and App_Resources are siblings."

rborn commented 7 years ago

@Fusion thanks for the feedback, I'll try to change the readme.

Related to the issue, as you can see I'm looking for a maintainer, so I'm not sure when I'll be able to look into it (if ever) 😟

Fusion commented 7 years ago

My bad! I remembered that I can still use the emulator. Running with --log trace I found out that the issue was not escaping double quotes in strings. I had not noticed that, while Android displayed the strings, they were stripped of quotes. iOs just hated it due to storing strings in the "key"="value" format.

rborn commented 7 years ago

So it actually works with 3.2.0 ?

Sent from my iPhone

On 10 Oct 2017, at 08:20, Chris F Ravenscroft notifications@github.com wrote:

My bad! I remembered that I can still use the emulator. Running with --log trace I found out that the issue was not escaping double quotes in strings. I had not noticed that, while Android displayed the strings, they were stripped of quotes. iOs just hated it due to storing strings in the "key"="value" format.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Fusion commented 7 years ago

Yes. It works for me. But only if I map global.L to the current model as I previously wrote :/

tscislo commented 6 years ago

For me it is working on 3.2.0 on Android with Angular without any modifications!