1

I'm building front-end prototypes for a number of related web apps that will need various text strings testing in 25+ languages (you know making sure the area reserved for a certain header etc works no matter what the language and doesn't screw the design).

It sounds like Mustache templating might be a good fit for this?

I'm hoping that I can write my templates incorporating mustache tags and then have example strings for each language placed in a JSON file and then use some kind of toggle (perhaps an alternate url to load a different language?) to test the template in different languages?

Could anyone who has used mustache before confirm whether this sounds like a plausible use case for it?

Are there any potential 'gotchas'? Or if anyone feels there is a better way to approach this issue, I'd be all ears!

Thanks for any pointers!

4

1 に答える 1

0

遠位をチェックしてください。

HTML でプロトタイプを作成し、英語のテキストを入力してから、HTML でどの要素のコンテンツを置き換えるかをマークします。

例えば、

<div data-qtext="main.intro">Welcome to StackOverflow</div>

<script>
var lang = {main: {intro: "Le France le StackOverflow"}};
function swap() {
  distal(document.body, lang);
}
</script>
于 2012-11-23T04:10:50.613 に答える