Making plugin work in the French version of Photoshop

I’m developing my plugin in the English version of Photoshop.

I have an sp-textfield that accepts user input.

<sp-textfield quiet type="number" id="offset" ></sp-textfield>

This textfield accepts numbers including decimals, like: 20.8

That works fine in the U.S. version of the plugin. However, in France, they need to enter their decimal numbers like: 20,8

They use a comma for the decimal point, not a period.

Unfortunately, since the sp-textfield’s type is “number” it doesn’t accept commas, and French users will only be able to enter whole numbers.

I’ve read here that I can get the “locale” using the following code:

const host = require('uxp').host;
const locale = host.uiLocale;
const hostName = host.name
const hostVersion = host.version;

console.log(`locale: ${locale}  host ${hostName} version ${hostVersion}`);

That works. But now what do I do with the locale so that this sp-textfield that requires numbers will accept commas in France?

Or is the best solution to change the sp-textfield’s type to “text” and monitor for incorrect entries?

Hey,
I’m French and developing in US locale but I can test that tomo eventually

Hrmm. This sounds like a bug.

If you use <input type="number">, do you see the same behavior, or is it improved (although with different styling)?

I’ll forward this to the UI team for their information.

Neither <sp-textfield type="number"> nor <input type="number"> allows the user to input commas in the U.S. version of Ps.

Maybe @Pierre_G can check the French version when he has time.