When installing Drupal the node's name and description gets translated (if you use the st()-function, like in /profiles/default/default.profile) and gets saved in the database. If you install a site in english and then add a language, for example swedish, the list admin/content/types/list remains in english.

The same thing when installing with in another language than english, the list will remain in whatever language it was initally installed with.

Modules who define their own node types have the same problem, which may result in node types in the list being in different languages.

The only drawback i can think of is that if you are used to work with node types in one language and for any reason change language, the different node types will be translated and will be sorted differently.

I've included a patch which fixes this. So that strings get translated when coming out of the database, instead of in. I've also adjusted the default.profile-file to match this change.

CommentFileSizeAuthor
node_type_translation-D7.patch1.89 KBTarnaurion

Comments

Tarnaurion’s picture

When I thought about the drawback I mentioned, I realized that you can always use the "type"-column, so this wouldn't be much of a drawback.

aufumy’s picture

I think this is a great suggestion, right now, I have added a bunch of t() 's around other modules that call node_get_types('name' ...). This solution seems more elegant.

Although I should probably be using tt() instead with module_exists('i18ncontent') around.

e.g. tt("nodetype:type:$content_type:name", $type_names[$content_type]);

Azol’s picture

Status: Active » Needs review

I think the translation should be consistent throughout the interface, because "you can translate this" but "you cannot translate that" is very confusing. i18n is a part of the solution. It eigher should be in D8 core, or just make t() work consistently thought all the interface features.
Let us give this a try

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.