Feature: include (all) sign languages in the 'LanguageElement' special rendering

This commit is contained in:
Pieter Vander Vennet 2025-08-23 17:46:07 +02:00
parent 2a3e164669
commit fe31af4b15
7 changed files with 2251 additions and 8 deletions

View file

@ -42,7 +42,7 @@
{#if $foundLanguages.length === 0 && on_no_known_languages && !$forceInputMode}
<div class="low-interaction flex items-center justify-between rounded p-1">
<div>
<div class="ml-1">
{on_no_known_languages}
</div>
<EditButton on:click={(_) => forceInputMode.setData(true)} />

View file

@ -7,7 +7,7 @@ export class LanguageElement extends SpecialVisualizationSvelte {
needsUrls = []
docs: string =
"The language element allows to show and pick all known (modern) languages. The key can be set"
"The language element allows to show and pick all known (modern) languages (includes sign languages). The key can be set"
args: {
name: string

View file

@ -106,7 +106,7 @@
<Tr t={Translations.t.general.useSearch} />
</label>
<div class="overflow-auto" style="max-height: 25vh">
<div style="max-height: 25vh">
{#each knownLanguagecodes as lng}
{#if isChecked[lng] && $newlyChecked.indexOf(lng) < 0 && probableLanguages.indexOf(lng) < 0}
<label class="no-image-background flex items-center gap-1">

View file

@ -21,6 +21,7 @@
import { Tag } from "../../../Logic/Tags/Tag"
import ChangeTagAction from "../../../Logic/Osm/Actions/ChangeTagAction"
import { And } from "../../../Logic/Tags/And"
import TagHint from "../TagHint.svelte"
export let question: string
export let prefix: string
@ -67,6 +68,10 @@
}
dispatch("save")
}
const showTags = state.userRelatedState.showTagsB
// For the preview
let asTags = selectedLanguages.mapD(lngs => lngs.map((ln) => new Tag(prefix + ln, "yes")))
</script>
<div class="disable-links interactive border-interactive flex flex-col p-2">
@ -74,7 +79,6 @@
<SpecialTranslation {feature} {layer} {state} t={new Translation({ "*": question })} {tags} />
</div>
<LanguageOptions {selectedLanguages} countries={$countries} />
<div class="flex w-full flex-wrap-reverse justify-end">
<slot name="cancel-button" />
<button
@ -85,4 +89,9 @@
<Tr t={Translations.t.general.save} />
</button>
</div>
{#if showTags}
<div class="subtle w-fit">
<TagHint tags={$asTags} />
</div>
{/if}
</div>

View file

@ -30,7 +30,11 @@ export default class WikidataUtils {
{ translations: Map<string, string>; directionality?: string[] }
>()
for (const element of data) {
let id = element.code.value
let id = element.code?.value
if(!id){
console.warn("No language code for", JSON.stringify(element),"ignoring")
continue
}
id = remapLanguages[id] ?? id
let labelLang = element.label["xml:lang"]
labelLang = remapLanguages[labelLang] ?? labelLang

File diff suppressed because it is too large Load diff