question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use angular-translate

See original GitHub issue

How can I use angular-translate in conjunction with this library?

Single:

<select class="chosen-select"
        chosen
        allow-single-deselect="true"
        data-placeholder="WE NEED TRANSLATION"
        no-results-text="WE NEED TRANSLATION"
        ng-model="someModel"
        ng-options="value for value in array">
</select>

Multiple:

<select class="chosen-select"
        chosen
        multiple
        allow-single-deselect="true"
        placeholder-text-multiple="WE NEED TRANSLATION"
        no-results-text="WE NEED TRANSLATION"
        data-ng-model="someModel"
        data-ng-options="value for value in array">
</select>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vstenecommented, Jul 20, 2015

It’s possible to translate it using the translate filter. Make sure you remember to wrap it around with ' so it’s a string.

<select chosen
        placeholder-single-text="'{{ 'my.translation.placeholder' | translate }}'"
        no-results-text="'{{ 'my.translation.noResults' | translate }}'" >
</select>

You cannot use data-placeholder as this attribute is not watched. Use one of these whitelisted attributes: https://github.com/localytics/angular-chosen/blob/master/src/chosen.coffee#L9-L23

0reactions
bettystegercommented, May 18, 2016

Yeah I also think that is a strange syntax 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with translation files - Angular
Extract the source language file. · Make a copy of the source language file to create a translation file for each language. ·...
Read more >
How To Use ngx-translate with Angular - DigitalOcean
Create a brand new Angular application and add some dependencies. Open your terminal and use @angular/cli to create a new project: ng new ......
Read more >
Doc: Guide - Angular Translate
Make sure to embed it in your HTML document. ... Inject angular-translate module as a dependency into your app: var app = angular.module('myApp',...
Read more >
Angular I18n: How to Internationalize with ngx-translate | Phrase
When it comes to Angular localization, one of the most popular open-source i18n libraries, ngx-translate, lets you define translations for ...
Read more >
ngx-translate/core: The internationalization (i18n) library for ...
Finally, you can use ngx-translate in your Angular project. You have to import TranslateModule.forRoot() in the root NgModule of your application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found