Reputation: 753
I'm working on a site that will support several languages. I create a template and a content item. Then I fill in the fields for language-specific versions of a content item. Thats OK.
I want to translate labels that go through the whole application. Let it be "More" label. I thought it is something about Dictionary and usage of Sitecore.Globalization.Translate.Text("More") but it doesn't work for pages with non-default language(provided I created a language-specific version of a dictionary item).
What is the correct solution?
Upvotes: 0
Views: 1840
Reputation: 1262
but it doesn't work for pages with non-default language(provided I created a language-specific version of a dictionary item)
Vitaliy,
Leveraging dictionary for this purpose is a proper way of doing it.
The Text method of Sitecore.Globalization.Translate class is supposed to respect the context language, so that should work.
public static string Text(string key)
{
Assert.ArgumentNotNull(key, "key");
return TextByLanguage(key, Context.Language);
}
Please file a ticket with tech support if that does not work for you.
Upvotes: 1