Developer Forum

Ask a Question

How to exclude localize from translating an angular widget that launches from our website

We launch an angular widget which has its own translating capabilities and would like to exclude this from our website from being detected by the localize script. Using a notranslate attribute or ignore attribute have been tried and do not work. We notice the widget application becomes extremely slow to respond when the localize script is active. Please suggest a solution to exclude the angular widget from being detected/operated on by the localize script altogether. Regards, Santosh
ANSWERED

maximum length of a phraseKey?

How long can a phrase key be? and what are the character limitations? are there any banned characters?
ANSWERED

Can't get Localize.on("initialize") to fire after initialization

I'm trying to use the `on initialize` example that is mentioned in the docs: https://developers.localizejs.com/docs/library-api#initialize-1 ```js Localize.on("initialize", function(data) { console.log("initialize: "); console.log(data); }); ``` Here's my full script: ```js (function(d, script) { script = d.createElement('script'); script.type = 'text/javascript'; script.async = true; script.onload = function(){ !function(a){if(!a.Localize){a.Localize={};for(var e=["translate","untranslate","phrase","initialize","translatePage","setLanguage","getLanguage","detectLanguage","getAvailableLanguages","untranslatePage","bootstrap","prefetch","on","off","hideWidget","showWidget","getSourceLanguage"],t=0;t<e.length;t++)a.Localize[e[t]]=function(){}}}(window); Localize.initialize({ key: 'xxx', rememberLanguage: true, saveNewPhrasesFromSource: true, }); Localize.on("initialize", function(data) { console.log("initialize: "); console.log(data); }); }; script.src = 'https://global.localizecdn.com/localize.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); ``` Right now ` Localize.initialize` works and I'm able to see the widget. The only thing not working is ` Localize.on("initialize", function(data) {`. It never fires the console.logs. Thanks.
ANSWERED

Specify variable within a meta tag

Because I see no way of defining a variable without using a <var> tag which is not possible. So our dynamic application with hundreds of thousands of titles all require a separate translation, right ?

Unable to write Unit test cases for Localize methods and its failed with issue

I have used localizejs on my Angular project and I started writing unit test cases for all my components but it failed with the below error as Localize global variable is found undefined on spec files. Error: ReferenceError: Localize is not defined Let me know if I am doing any wrong implementation of my test cases in respect to Localize. Thanks
ANSWERED

Can we create a way to avoid sending filenames to the dashboard

Is there a way as a developer when writing the website without access to the dashboard that I can avoid the phrases I am writing from being sent to the localise.js dashboard? For example, filenames or system logs should not be sent to the localize dashboard.
ANSWERED

Is Localize compatible with SSRS?

We have SSRS reports generated in our application, but localize does not identify the words inside report. How can we go about it?
ANSWERED

Identify language

Is there any way where whenever we change the language in application by Localize widget, an event must be fired so that according to the language set, I can do changes to my UI or content?
ANSWERED

Search by phrase text API

Is there an API end-point that could be used to search for phrases by text? It is not feasible to get all phrases via `/phrases` and go one by one to find the phrase I'm interested in so that I can update its translation. I can see there's an internal API used by the In-Context Editor to get a phrase by exact match, would this be made available in the public API?
ANSWERED

Another date formatting question

We have many places in our application where we display the date in the following format: 01 Jan 2021 (DD MMM YYYY) Is there a way we can mark these instances in HTML with an attribute or something that would let Localize know that it should translate it? Currently every date is getting put in our Pending queue. I see this discussion from a while back but don't know if any progress had been made on it? https://help.localizejs.com/discuss/5dcb4c0682dc230072c71f27 Thank you, Justin