Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8: Allow localizing content types and properties using language files #5358

Merged

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Apr 29, 2019

Prerequisites

  • I have added steps to test this contribution in the description below

Description

If you want to localize content type and property names in the backoffice, you currently have to do it using the dictionary. This is convenient if you have the same languages in frontend and backoffice, but if you don't... well, things get messy

From a conceptual point of view, doing backoffice localization using the dictionary isn't terribly pretty, because the dictionary is pretty much a frontend thing.

So! This PR makes it possible to do the same localization of backoffice names using the language files. The naming follows the same convention as the dictionary based localization; you add the "#"-prefix and then specify the localization key as either [area]/[key] or [area]_[key] :

image

The corresponding localization file (e.g. en-US.user.xml) would look something like this:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language>
    <area alias="contentTypes">
        <key alias="home">Name for Home</key>
    </area>
    <area alias="properties">
        <key alias="title">Name for Title</key>
    </area>
</language>

And the result:

image

image

Testing this PR

  1. Create a content type and localize its name and properties as described above.
  2. Create matching localizations in two user language files (e.g. en-US.user.xml and da-DK.user.xml).
  3. Test both languages by flipping your backoffice user language.

@emmaburstow
Copy link
Contributor

Hey @kjac

Thanks for the work. If we need you we'll let you know,

Em

@nul800sebastiaan nul800sebastiaan merged commit ba12efd into umbraco:v8/dev May 31, 2019
@nul800sebastiaan
Copy link
Member

This is sweet, thank you kindly! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants