Small tweaks to translation label

This commit is contained in:
pietervdvn 2021-02-20 03:29:55 +01:00
parent e2d5cefda3
commit dcdb5b9a22
12 changed files with 56 additions and 33 deletions

View file

@ -54,7 +54,7 @@ export default class AllTranslationAssets {
openLayerControl: new Translation( {"en":"Open the layer control box","ca":"Obrir el control de capes","es":"Abrir el control de capas","nl":"Open de laag-instellingen","fr":"Ouvrir la panneau de contrôle","de":"Das Ebenen-Kontrollkästchen öffnen"} ),
layerNotEnabled: new Translation( {"en":"The layer {layer} is not enabled. Enable this layer to add a point","ca":"La capa {layer} no està habilitada. Fes-ho per poder afegir un punt a aquesta capa","es":"La capa {layer} no está habilitada. Hazlo para poder añadir un punto en esta capa","nl":"De laag {layer} is gedeactiveerd. Activeer deze om een punt toe te voegen","fr":"La couche [layer] est désactivée. Activez-la pour ajouter un point.","de":"Die Ebene {layer} ist nicht aktiviert. Aktivieren Sie diese Ebene, um einen Punkt hinzuzufügen"} ),
},
pickLanguage: new Translation( {"en":"Choose a language","ca":"Tria idioma","es":"Escoge idioma","nl":"Kies je taal","fr":"Choisir la langue","gl":"Escoller lingua","de":"Wählen Sie eine Sprache"} ),
pickLanguage: new Translation( {"en":"Choose a language","ca":"Tria idioma","es":"Escoge idioma","nl":"Kies je taal: ","fr":"Choisir la langue","gl":"Escoller lingua","de":"Wählen Sie eine Sprache"} ),
about: new Translation( {"en":"Easily edit and add OpenStreetMap for a certain theme","ca":"Edita facilment i afegeix punts a OpenStreetMap d'una temàtica determinada","es":"Edita facilmente y añade puntos en OpenStreetMap de un tema concreto","nl":"Bewerk en voeg data toe aan OpenStreetMap over een specifiek onderwerp op een gemakkelijke manier","fr":"Éditer facilement et ajouter OpenStreetMap pour un certain thème","gl":"Editar doadamente e engadir puntos no OpenStreetMap dun eido en concreto","de":"OpenStreetMap für ein bestimmtes Thema einfach bearbeiten und hinzufügen"} ),
nameInlineQuestion: new Translation( {"en":"The name of this {category} is $$$","ca":"{category}: El seu nom és $$$","es":"{category}: Su nombre es $$$","nl":"De naam van dit {category} is $$$","fr":"Le nom de cet/cette {category} est $$$","gl":"{category}: O teu nome é $$$","de":"Der Name dieser {category} ist $$$"} ),
noNameCategory: new Translation( {"en":"{category} without a name","ca":"{category} sense nom","es":"{category} sin nombre","nl":"{category} zonder naam","fr":"{category} sans nom","gl":"{category} sen nome","de":"{category} ohne Namen"} ),

View file

@ -276,6 +276,16 @@ export default class MetaTagging {
}
);
private static currentTime = new SimpleMetaTagger(
["_date:now"],
"Adds the time that the data got loaded - pretty much the time of downloading from overpass. The format is YYYY-MM-DD hh:mm, aka 'sortable' aka ISO-8601-but-not-entirely",
feature => {
const now = new Date();
// @ts-ignore
feature.properties["_date:now"] = now.toISOString().splice(0,-5).replace("T", " ");
}
)
private static metatags = [
MetaTagging.latlon,
@ -283,7 +293,8 @@ export default class MetaTagging {
MetaTagging.country,
MetaTagging.isOpen,
MetaTagging.carriageWayWidth,
MetaTagging.directionSimplified
MetaTagging.directionSimplified,
MetaTagging.currentTime
];

View file

@ -265,3 +265,5 @@ Bench icons from StreetComplete: https://github.com/westnordost/StreetComplete/t
Urinal icon: https://thenounproject.com/term/urinal/1307984/
24/7 icon: https://www.vecteezy.com/vector-art/1394992-24-7-service-and-support-icon-set
Translation-icon: https://commons.wikimedia.org/wiki/File:OOjs_UI_icon_language-ltr.svg

7
Svg.ts
View file

@ -299,6 +299,11 @@ export default class Svg {
public static statistics_svg() { return new FixedUiElement(Svg.statistics);}
public static statistics_ui() { return new FixedUiElement(Svg.statistics_img);}
public static translate = " <!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"> <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 65 65\" enable-background=\"new 0 0 96 96\" xml:space=\"preserve\" width=\"100%\" height=\"100%\"> <g transform=\"translate(-15.5,-15.5)\"> <path d=\"m 46.4,52.6 c -4.2,-4.1 -7.9,-7.7 -10,-16 H 51.1 V 30.4 H 36.5 v -8.2 h -6.3 v 8.3 H 15.5 v 6.2 h 15 c 0,0 -0.1,1.2 -0.3,2.1 -2.1,8.2 -4.6,13.4 -14.7,18.5 l 2.1,6.2 C 27.2,58.4 32.2,52 34.4,44.9 c 2.1,5.4 5.7,9.8 9.8,13.8 l 2.2,-6.1 z\" /> <path d=\"M 65.8,32.5 H 57.4 L 42.7,73.8 H 49 L 53.2,61.4 H 70 l 4.2,12.4 h 6.3 L 65.8,32.5 z m -10.5,22.7 6.3,-16.5 6.3,16.6 -12.6,-0.1 0,0 z\" /> </g> </svg> "
public static translate_img = Img.AsImageElement(Svg.translate)
public static translate_svg() { return new FixedUiElement(Svg.translate);}
public static translate_ui() { return new FixedUiElement(Svg.translate_img);}
public static up = " <svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.0\" width=\"700\" height=\"700\"> <g transform=\"translate(19.99999,28.57142)\"> <path d=\"M -20,670.71582 C -20,668.85739 329.99229,-29.27271 330.57213,-28.57089 C 332.51762,-26.21611 680.63965,670.88998 679.99913,671.14838 C 679.58076,671.31716 600.70188,637.45746 504.71273,595.90461 L 330.18699,520.35396 L 155.94489,595.89128 C 60.11172,637.43679 -18.680347,671.42858 -19.148608,671.42858 C -19.616868,671.42858 -19.99999,671.10783 -19.99999,670.71582 z \" style=\"fill:#00ff00;stroke:none\" /> </g> </svg> "
public static up_img = Img.AsImageElement(Svg.up)
public static up_svg() { return new FixedUiElement(Svg.up);}
@ -319,4 +324,4 @@ export default class Svg {
public static wikipedia_svg() { return new FixedUiElement(Svg.wikipedia);}
public static wikipedia_ui() { return new FixedUiElement(Svg.wikipedia_img);}
public static All = {"Ornament-Horiz-0.svg": Svg.Ornament_Horiz_0,"Ornament-Horiz-1.svg": Svg.Ornament_Horiz_1,"Ornament-Horiz-2.svg": Svg.Ornament_Horiz_2,"Ornament-Horiz-3.svg": Svg.Ornament_Horiz_3,"Ornament-Horiz-4.svg": Svg.Ornament_Horiz_4,"Ornament-Horiz-5.svg": Svg.Ornament_Horiz_5,"Ornament-Horiz-6.svg": Svg.Ornament_Horiz_6,"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"back.svg": Svg.back,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"circle.svg": Svg.circle,"clock.svg": Svg.clock,"close.svg": Svg.close,"compass.svg": Svg.compass,"cross_bottom_right.svg": Svg.cross_bottom_right,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"phone.svg": Svg.phone,"pin.svg": Svg.pin,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"ring.svg": Svg.ring,"search.svg": Svg.search,"send_email.svg": Svg.send_email,"share.svg": Svg.share,"square.svg": Svg.square,"star.svg": Svg.star,"star_half.svg": Svg.star_half,"star_outline.svg": Svg.star_outline,"star_outline_half.svg": Svg.star_outline_half,"statistics.svg": Svg.statistics,"up.svg": Svg.up,"wikidata.svg": Svg.wikidata,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};}
public static All = {"Ornament-Horiz-0.svg": Svg.Ornament_Horiz_0,"Ornament-Horiz-1.svg": Svg.Ornament_Horiz_1,"Ornament-Horiz-2.svg": Svg.Ornament_Horiz_2,"Ornament-Horiz-3.svg": Svg.Ornament_Horiz_3,"Ornament-Horiz-4.svg": Svg.Ornament_Horiz_4,"Ornament-Horiz-5.svg": Svg.Ornament_Horiz_5,"Ornament-Horiz-6.svg": Svg.Ornament_Horiz_6,"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"back.svg": Svg.back,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"circle.svg": Svg.circle,"clock.svg": Svg.clock,"close.svg": Svg.close,"compass.svg": Svg.compass,"cross_bottom_right.svg": Svg.cross_bottom_right,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"phone.svg": Svg.phone,"pin.svg": Svg.pin,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"ring.svg": Svg.ring,"search.svg": Svg.search,"send_email.svg": Svg.send_email,"share.svg": Svg.share,"square.svg": Svg.square,"star.svg": Svg.star,"star_half.svg": Svg.star_half,"star_outline.svg": Svg.star_outline,"star_outline_half.svg": Svg.star_outline_half,"statistics.svg": Svg.statistics,"translate.svg": Svg.translate,"up.svg": Svg.up,"wikidata.svg": Svg.wikidata,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};}

View file

@ -12,8 +12,8 @@ export default class Img {
return `data:image/svg+xml;base64,${(btoa(source))}`;
}
static AsImageElement(source: string, css_class: string = ""): string{
return `<img class="${css_class}" alt="" src="${Img.AsData(source)}">`;
static AsImageElement(source: string, css_class: string = "", style=""): string{
return `<img class="${css_class}" style="${style}" alt="" src="${Img.AsData(source)}">`;
}
}

View file

@ -98,8 +98,7 @@ export default class MoreScreen extends UIElement {
linkButton.push(this.createLinkButton(layout));
}
els.push(new Combine(linkButton))
els.push(new VariableUiElement(
State.state.osmConnection.userDetails.map(userDetails => {
if (userDetails.csCount < Constants.userJourney.themeGeneratorReadOnlyUnlock) {
@ -112,6 +111,9 @@ export default class MoreScreen extends UIElement {
})
));
els.push(new Combine(linkButton))
const customThemesNames = State.state.installedThemes.data ?? [];
if (customThemesNames.length > 0) {

View file

@ -156,7 +156,7 @@ export default class ShareScreen extends UIElement {
let hash = "";
if (layoutDefinition !== undefined) {
literalText = `https://${host}${path}/`
if (layout.id.startsWith("wiki:")) {
if (layout.id.startsWith("http")) {
parts.push("userlayout=" + encodeURIComponent(layout.id))
} else {
hash = ("#" + layoutDefinition)

View file

@ -25,7 +25,7 @@ export default class UserBadge extends UIElement {
super(State.state.osmConnection.userDetails);
this._userDetails = State.state.osmConnection.userDetails;
this._languagePicker = (LanguagePicker.CreateLanguagePicker(State.state.layoutToUse.data.language) ?? new FixedUiElement(""))
.SetStyle("display:inline-block;width:min-content;");
.SetStyle("width:min-content;");
this._loginButton = Translations.t.general.loginWithOpenStreetMap
.Clone()
@ -70,15 +70,23 @@ export default class UserBadge extends UIElement {
return this._loginButton.Render();
}
const linkStyle = "flex items-baseline"
let messageSpan: UIElement =
new Link(
new Combine([Svg.envelope, "" + user.totalMessages]),
new Combine([Svg.envelope, "" + user.totalMessages]).SetClass(linkStyle),
'https://www.openstreetmap.org/messages/inbox',
true
)
const csCount =
new Link(
new Combine([Svg.star, "" + user.csCount]).SetClass(linkStyle),
`https://www.openstreetmap.org/user/${user.name}/history`,
true);
if (user.unreadMessages > 0) {
messageSpan = new Link(
new Combine([Svg.envelope, "" + user.unreadMessages]),
@ -111,20 +119,14 @@ export default class UserBadge extends UIElement {
true);
const csCount =
new Link(
new Combine([Svg.star, "" + user.csCount]),
`https://www.openstreetmap.org/user/${user.name}/history`,
true);
const userStats = new Combine([
this._homeButton,
settings,
messageSpan,
csCount,
this._logout,
this._languagePicker])
this._languagePicker,
this._logout
])
.SetClass("userstats")
const usertext = new Combine([

View file

@ -62,7 +62,7 @@ export class DropDown<T> extends InputElement<T> {
options += "<option value='" + i + "'>" + this._values[i].shown.InnerRender() + "</option>"
}
return `<form>` +
return `<form class="flex">` +
`<label class='${this._label_class}' for='dropdown-${this.id}'>${this._label.Render()}</label>` +
`<select class='${this._select_class}' name='dropdown-${this.id}' id='dropdown-${this.id}'>` +
options +

View file

@ -1,6 +1,8 @@
import {UIElement} from "./UIElement";
import {DropDown} from "./Input/DropDown";
import Locale from "./i18n/Locale";
import Svg from "../Svg";
import Img from "./Base/Img";
export default class LanguagePicker {
@ -12,11 +14,11 @@ export default class LanguagePicker {
if (languages.length <= 1) {
return undefined;
}
return new DropDown("Change Language", languages.map(lang => {
return new DropDown(label, languages.map(lang => {
return {value: lang, shown: lang}
}
), Locale.language, 'sr-only', 'bg-indigo-100 p-1 rounded hover:bg-indigo-200');
), Locale.language, '', 'bg-indigo-100 p-1 rounded hover:bg-indigo-200');
}

View file

@ -10,6 +10,7 @@
},
"description": {
"en": "Create a personal theme based on all the available layers of all themes",
"nl": "Stel je eigen thema samen door lagen te combineren van alle andere themas",
"es": "Crea una interficie basada en todas las capas disponibles de todas las interficies",
"ca": "Crea una interfície basada en totes les capes disponibles de totes les interfícies",
"gl": "Crea un tema baseado en todas as capas dispoñíbeis de todos os temas",
@ -30,8 +31,6 @@
"startLon": 0,
"startZoom": 16,
"widenFactor": 0.05,
"layers": [
"drinking_water"
],
"layers": [ ],
"roamingRenderings": []
}

View file

@ -413,13 +413,13 @@
}
},
"pickLanguage": {
"en": "Choose a language",
"ca": "Tria idioma",
"es": "Escoge idioma",
"nl": "Kies je taal",
"fr": "Choisir la langue",
"gl": "Escoller lingua",
"de": "Wählen Sie eine Sprache"
"en": "Choose a language: ",
"ca": "Tria idioma: ",
"es": "Escoge idioma: ",
"nl": "Kies je taal: ",
"fr": "Choisir la langue: ",
"gl": "Escoller lingua: ",
"de": "Wählen Sie eine Sprache: "
},
"about": {
"en": "Easily edit and add OpenStreetMap for a certain theme",