Gowri
Gowri

Reputation: 1856

Localization not working in input placeholder

I'm using Jquery localize for localization.

The text in the placeholder attribute not changing.

Here is my code:

 <input type="text" id="qty"  data-translate="input" placeholder="Qty">

And the language json code:

{
   "input" : {
        "Qty" : "Quantity"
    }
}

Upvotes: 2

Views: 3236

Answers (3)

Govind Samrow
Govind Samrow

Reputation: 10189

Use value field ,Its working for me.

"login": {
    "unm": {
        "value": "User name"
    }
}

<input data-localize="login.unm" type="text" name="user_name" value="" placeholder="User Name" />

Upvotes: 2

hbulens
hbulens

Reputation: 1969

If you consult the documentation, you'll find that this is how you should do it:

<input type="text" id="qty" data-localize="input.Qty">

Upvotes: 0

Valentyn Vynogradskiy
Valentyn Vynogradskiy

Reputation: 653

try change

   {
   "input" : {
        "Qty" : "Quantity"
    }
}

to:

{
   "input" : {
        "placeholder" : "Quantity"
    }
}

Upvotes: 0

Related Questions