Translation visible in User dropdown?!
# package-development
w
Translation/language question. Am I supposed to see my translation as a language in the Users dropdown?!
Copy code
ts
import { ManifestLocalization } from "@umbraco-cms/backoffice/extension-registry";

const localizations: ManifestLocalization = {
    name: "Examine Peek Localizations (EN-US)",
    alias: "examinepeek.localizations.en-us",
    type: "localization",
    meta: {
        culture: "en-US",
        direction: "ltr",
        localizations : {
            "examinepeek": {
                "modal-title": "Examine Peek"
            }
        }
    }
}

export const manifests = [localizations];
j
it groups based on culture, but we probably forgot to compare lowercase somewhere
w
Suggestion provide an enum or something as you know all the culture codes it could be, so I can just autocomplete it and not mess it up 🙈
j
sure
feel free to contribute if we don't get to it first 🙂
w
Need more hours in the day or more versions of me to do that right now
OK I lower cases the
culture
property to be
en-us
to match the same casing as the localization file that you have in CMS core. So still unsure what I am doing wrong. Looking for any pointers HQ gang @Jacob Overgaard or @Niels Lyngsø when you see this next ?! 😕
Copy code
ts
import { ManifestLocalization } from "@umbraco-cms/backoffice/extension-registry";

const localizations: ManifestLocalization = {
    name: "English (US)",
    alias: "examinepeek.localizations.en-us",
    type: "localization",
    meta: {
        culture: "en-us",
        localizations : {
            "examinepeek": {
                "modal-title": "Examine Peek"
            }
        }
    }
}

export const manifests = [localizations];
Also can I only use localize.term in the context of a webcomponent only ? As I would like to translate a term for my entity action manifest. I can't seem to import and new up
UmbLocalizationController
as it needs an ElementHost from what I understand.
Copy code
ts
import { UMB_DOCUMENT_ENTITY_TYPE } from "@umbraco-cms/backoffice/document";
import { ManifestEntityAction } from "@umbraco-cms/backoffice/extension-registry";
import { ExaminePeekEntityAction } from "./examinepeek.entityaction.ts";


const entityAction: ManifestEntityAction = {
    type: 'entityAction',
    kind: 'default',
    alias: 'examinepeek.entity.action',
    name: 'Examine Peek Entity Action',
    weight: 400,
    api: ExaminePeekEntityAction,
    meta: {
        icon: 'icon-sensor',
        label: 'Examine Peek TRANSLATE ME',
    },
    forEntityTypes: [ UMB_DOCUMENT_ENTITY_TYPE ]
}
export const manifests = [entityAction];
Other feedback & thoughts... If I use localize.term() it would be good to provide a fallback string if you can't find the translation in another language file
j
The concept of localization for manifests hasn't been built yet, sorry
w
Ok one for you and the team to jot down 🙂
j
Of course