0

I can generate random string just like here.

But are there some tools to generate same string according to user language? So you can just pass language code and get a string?

Community
  • 1
  • 1
crumb
  • 25
  • 4

1 Answers1

1

This problem is called "internationalization" or i18n.

If you google "javascript internationalization" you'll find several projects that could help, including:

http://i18next.com/

http://formatjs.io/

https://slexaxton.github.io/Jed/

I've used Jed before and it worked well for me.

Andrew
  • 42,517
  • 51
  • 181
  • 281
  • whatever the OP really asks or want, I believe this is the only acceptable answer that can be provided ☺ – zmo Mar 07 '16 at 19:23
  • Hmm actually upon reading the comments on the original question I'm not sure if this is what you're looking for. I didn't see you want *random* strings in different languages... I'm not sure what that means. – Andrew Mar 07 '16 at 19:24
  • 1
    well, it doesn't mean much. Maybe he wants to extract a random word out of a dictionary, choosing the dictionary depending on the language? either way, this question is going to get closed, and likely to be deleted. Meanwhile, people coming after looking for `string,different,language,javascript` will see your list of i18n projects :-) – zmo Mar 07 '16 at 19:25
  • @Andrew, it is a game where you need to guess word. For example: word 'apple' can be hiden in the string 'alrpepqyv'. As you can, see there are redundant chars in the string. But in another language there are other chars – crumb Mar 07 '16 at 19:32
  • 1
    @crumb you should specify that in your question, then it won't get closed. To solve that I think you're going to need to have two things: a wordlist to internationalize (translate) and a character list to sample. The tools listed can help with the translation part, and you could adapt that for character sampling as well. – Andrew Mar 07 '16 at 19:37