Why do people use plain english as translation placeholders?

前端 未结 8 714
有刺的猬
有刺的猬 2020-12-15 03:28

This may be a stupid question, but here goes.

I\'ve seen several projects using some translation library (e.g. gettext) working with plain english placeholders. So f

8条回答
  •  长情又很酷
    2020-12-15 03:45

    There's a fallback hierarchy, from most specific locale to the unlocalised version in the source code.

    So French in France might have the following fallback route:

    1. fr_FR
    2. fr
    3. Unlocalised. Source code.

    As a result, having proper English sentences in the source code ensures that if a particular translation is not provided for in step (1) or (2), you will at least get a proper understandable sentence than random programmer garbage like “error_file_not_found”.

    Plus, what do you do if it is a format string: “Sorry but the %s does not exist” ? Worse still: “Written %s entries to %s, total size: %d” ?

提交回复
热议问题