Skip to content

Comment on How to design in every language at once

Comments

Interesting article. How do people usually name their keys in their i18n data files? For example, do you name based on the 'what' or the 'where'?

The what:

greeting: "Hello"

or the where:

dashboard.header: "Hello"

edit: I guess you could do both

dashboard.header:

  greeting: "Hello"

Personally I like to add the context of the string, not at what place it is used.

For example:

  title.welcome = "Welcome"
  button.submit = "Submit"
In my experience this makes reusing of texts much easier and there will be less to translate. Because the same welcome title could be used in the dashboard header but also at other places.

But I think this is just a matter of taste. Use what works for you.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.