nativescript-bottom-navigation icon indicating copy to clipboard operation
nativescript-bottom-navigation copied to clipboard

Template BottomNavigationTab initialization not working with localization

Open nea opened this issue 6 years ago • 6 comments

Which platform(s) does your issue occur on?

  • Android
  • 7.1.1
  • emulator

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

  • CLI: 3.4.2
  • Cross-platform modules: 3.4.1
  • Runtime(s): 3.4.1
  • Plugin(s): "dependencies": { "@angular/animations": "~5.2.0", "@angular/common": "~5.2.0", "@angular/compiler": "~5.2.0", "@angular/core": "~5.2.0", "@angular/forms": "~5.2.0", "@angular/http": "~5.2.0", "@angular/platform-browser": "~5.2.0", "@angular/platform-browser-dynamic": "~5.2.0", "@angular/router": "~5.2.0", "nativescript-angular": "~5.2.0", "nativescript-bottom-navigation": "^1.2.0", "nativescript-bottombar": "^3.0.8", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "~5.5.2", "tns-core-modules": "~3.4.0", "zone.js": "~0.8.2" }, "devDependencies": { "babel-traverse": "6.4.5", "babel-types": "6.4.5", "babylon": "6.4.5", "lazy": "1.0.11", "nativescript-dev-typescript": "~0.6.0", "typescript": "~2.6.2" }

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

nea avatar Mar 17 '18 10:03 nea

Hi (again haha),

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

On Mar 17, 2018 5:12 AM, "Savas Ziplies" [email protected] wrote:

Which platform(s) does your issue occur on?

  • Android
  • 7.1.1
  • emulator

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

  • CLI: 3.4.2
  • Cross-platform modules: 3.4.1
  • Runtime(s): 3.4.1
  • Plugin(s): "dependencies": { "@angular/animations": "~5.2.0", "@angular/common": "~5.2.0", "@angular/compiler": "~5.2.0", "@angular/core": "~5.2.0", "@angular/forms": "~5.2.0", "@angular/http": "~5.2.0", "@angular/platform-browser": "~5.2.0", "@angular/platform-browser-dynamic": "~5.2.0", "@angular/router": "~5.2.0", "nativescript-angular": "~5.2.0", "nativescript-bottom-navigation": "^1.2.0", "nativescript-bottombar": "^3.0.8", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "~5.5.2", "tns-core-modules": "~3.4.0", "zone.js": "~0.8.2" }, "devDependencies": { "babel-traverse": "6.4.5", "babel-types": "6.4.5", "babylon": "6.4.5", "lazy": "1.0.11", "nativescript-dev-typescript": "~0.6.0", "typescript": "~2.6.2" }

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/henrychavez/nativescript-bottom-navigation/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AF0NmZYzPkpuFINtqnsnN6hQi2xLOOB7ks5tfOGVgaJpZM4Suv2L .

henrychavez avatar Mar 17 '18 15:03 henrychavez

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

nea avatar Mar 19 '18 07:03 nea

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

henrychavez avatar Mar 21 '18 22:03 henrychavez

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

nickykln avatar Nov 20 '18 09:11 nickykln

Hey @nickykln

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

Sorry

nea avatar Nov 20 '18 09:11 nea

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

henrychavez avatar Nov 20 '18 15:11 henrychavez