henrychavez / nativescript-bottom-navigation

Nativescript plugin for Android & iOS to have the bottom navigation bar of Material Design
Apache License 2.0
58 stars 18 forks source link

Template BottomNavigationTab initialization not working with localization #14

Open nea opened 6 years ago

nea commented 6 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Hi (me again ^^)

I am using the ns-localize bundle (https://github.com/lfabreges/nativescript-localize) for translations and wanted to also include it on the tabs. But when I define the tabs in the template the localization does not work.

So <BottomNavigationTab title="{{ 'calendar' | L }}" icon="calendar"></BottomNavigationTab> does not work, but new BottomNavigationTab(localize('calendar'), "calendar") works.

The localization in general works. I added a text field to check if the key gets translated. I don't know if this is an issue here or on the localization side as I don't know in which order things are handled internally, e.g. before passing to the class.

So, more to let you know if this is something on your side :)

Thanks again for the plugin

henrychavez commented 6 years ago

Hi (again haha),

Try with this [title]=" 'text' | L"

On Mar 17, 2018 5:12 AM, "Savas Ziplies" notifications@github.com wrote:

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Hi (me again ^^)

I am using the ns-localize bundle (https://github.com/lfabreges/ nativescript-localize) for translations and wanted to also include it on the tabs. But when I define the tabs in the template the localization does not work.

So

does not work, but new BottomNavigationTab(localize('calendar'), "calendar") works. The localization in general works. I added a text field to check if the key gets translated. I don't know if this is an issue here or on the localization side as I don't know in which order things are handled internally, e.g. before passing to the class. So, more to let you know if this is something on your side :) Thanks again for the plugin — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
nea commented 6 years ago

Hi @henrychavez

Unfortunately, the same.

Nothing: <BottomNavigationTab title="{{ 'calendar' | L }}" icon="calendar"></BottomNavigationTab>

Nothing: <BottomNavigationTab [title]=" 'calendar' | L " icon="calendar"></BottomNavigationTab>

Parse error: <BottomNavigationTab [title]="{{ 'calendar' | L }}" icon="calendar"></BottomNavigationTab>

Best

henrychavez commented 6 years ago

Ok, I'll try to do some test this weekend and I'll reach you as soon as I get the solution.

nickykln commented 5 years ago

Hello @henrychavez

Did you have time to work on this issue ? @nea : Did you find any workaround ?

Thanks a lot for your helps guys,

Nicolas

nea commented 5 years ago

Hey @nickykln

Sorry, I didn't use it in the end and changed my layout to something different.

Sorry

henrychavez commented 5 years ago

@nickykln @nea unfortunately don't but I'll try to run some tests this weekend