We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Localize by Id

Thread ID:

Created:

Updated:

Platform:

Replies:

142623 Feb 12,2019 03:07 PM UTC Feb 13,2019 07:31 PM UTC Angular - EJ 2 1
loading
Tags: Textbox
Tobias Heer
Asked On February 12, 2019 03:07 PM UTC

Hi,

is it possible to localize a control by it's id?

I know that i can localize a textbox with a localization-object like this:
{
"de-DE": {
"textbox": {
"placeholder": "Suchen ..."
}
}
}
This works fine. 
But what if i have multiple textboxes?

Every textbox has the same placeholder text.

Can i somehow access each textbox via id in the localization-object?

I tried to do it like this:

"textbox.id['inputSearch']": {
"placeholder": "Suchen ..."
}
But this does not seem to work.

Is there a way to set the localization for each control individually.

Thank you.


Prince Oliver [Syncfusion]
Replied On February 13, 2019 07:31 PM UTC

Hi Tobias, 

Thank you for using Syncfusion products. 

We can localize the place holder value of the Textbox component for the specific culture globally not for the individual component. So, we have achieved your requirement as the work around by defined the required placeholder values for the specific culture (“de-DE“) in the localization object. After that, we have assigned the required placeholder value to the specific text box placeholder property as like in the below code example. 

[app.component.html] 
<div class="row"> 
    <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> 
        <ejs-textbox [placeholder]="placeholder" floatLabelType="Auto" locale="de-DE"></ejs-textbox> 
    </div> 
    <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> 
        <ejs-textbox [placeholder]="placeholder2" locale="de-DE" floatLabelType="Auto"></ejs-textbox> 
    </div> 
    <div class="col-xs-6 col-sm-6 col-lg-6 col-md-6"> 
        <ejs-textbox placeholder="Last Name" floatLabelType="Auto"></ejs-textbox> 
    </div> 
</div> 

[app.component.ts] 
export class DefaultTextboxController { 
    placeHolder: object = { 
        "de-DE": { 
            name: "Suchen ...", 
            FirstName: "Vorname" 
        } 
    } 
    public placeholder = this.placeHolder["de-DE"].name; 
    public placeholder2 = this.placeHolder["de-DE"].FirstName; 
} 

Please check the sample from the below link. 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;