I have created a contract using solidity which has a comment field. I want to provide multi language support so that user can insert and retrieve comment in any language.
Please suggest how we can achieve this feature?
Instead of using just a single
string to store the comment, you will have to use an
mapping to store all the translations. For example, you could create a mapping of two-letter language codes to the versions of the comment in that language:
mapping (bytes2 => string) languageCodeToComment;
Now, you can add a comment in multiple langauges:
languageCodeToComment["EN"] = "This is the English comment!";
languageCodeToComment["NL"] = "Dit is het Nederlandse bericht!";
languageCodeToComment["FY"] = "Dit is yn it Frysk!";