forked from MapComplete/MapComplete
Fix rendering bug
This commit is contained in:
parent
3edca23b90
commit
e62f71a51d
2 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,9 @@ export default class LinkToWeblate extends VariableUiElement {
|
|||
if(availableTranslations["*"] !== undefined){
|
||||
return undefined
|
||||
}
|
||||
if(context === undefined || context.indexOf(":") < 0){
|
||||
return undefined
|
||||
}
|
||||
const icon = Svg.translate_svg()
|
||||
.SetClass("rounded-full border border-gray-400 inline-block w-4 h-4 m-1 weblate-link self-center")
|
||||
if(availableTranslations[ln] === undefined){
|
||||
|
@ -24,6 +27,9 @@ export default class LinkToWeblate extends VariableUiElement {
|
|||
}
|
||||
|
||||
public static hrefToWeblate(language: string, contextKey: string): string{
|
||||
if(contextKey === undefined || contextKey.indexOf(":") < 0){
|
||||
return undefined
|
||||
}
|
||||
const [category, ...rest] = contextKey.split(":")
|
||||
const key = rest.join(":")
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ class TranslatorsPanelContent extends Combine {
|
|||
})
|
||||
|
||||
const missingTranslationsFor = (ln: string) => Utils.NoNull(untranslated.get(ln) ?? [])
|
||||
.filter(ctx => ctx.indexOf(":") >= 0)
|
||||
.map(ctx => ctx.replace(/note_import_[a-zA-Z0-9_]*/, "note_import"))
|
||||
.map(context => new Link(context, LinkToWeblate.hrefToWeblate(ln, context), true))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue