Skip to content

Commit

Permalink
Merge pull request #1429 from RobAndrewHurst/dictionary_fix
Browse files Browse the repository at this point in the history
Fix language differences
  • Loading branch information
RobAndrewHurst authored Aug 22, 2024
2 parents 199f792 + 9c45a01 commit d54dda0
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 97 deletions.
22 changes: 11 additions & 11 deletions lib/ui/elements/contextMenu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mapp.utils.merge(mapp.dictionaries, {
remove_last_vertex: '最後のバーテックスを削除',
delete_vertex: 'バーテックスを削除',
},
es: {
esp: {
remove_last_vertex: 'Eliminar el último vértice',
delete_vertex: 'Eliminar vértice',
},
Expand All @@ -53,9 +53,9 @@ mapp.utils.merge(mapp.dictionaries, {
function modify(e) {

e && e.preventDefault()

const menu = []

// Show save option in contextmenu
menu.push(mapp.utils.html`
<li
Expand All @@ -65,36 +65,36 @@ function modify(e) {
// Add cancel option to contextmenu.
menu.push(mapp.utils.html`
<li
onclick=${()=>this.interaction.finish()}>
onclick=${() => this.interaction.finish()}>
${mapp.dictionary.cancel}`)

// Set context menu popup on last vertex.
this.popup({
coords: this.interaction.vertices[this.interaction.vertices.length-1],
coords: this.interaction.vertices[this.interaction.vertices.length - 1],
content: mapp.utils.html.node`<ul>${menu}`,
})
}

function draw(e) {

if (this.interaction.vertices.length === 0) return;

const menu = []

menu.push(mapp.utils.html`
<li
onclick=${()=>this.interaction.finish(this.interaction.getFeature())}>
onclick=${() => this.interaction.finish(this.interaction.getFeature())}>
${mapp.dictionary.save}`)

menu.push(mapp.utils.html`
<li
onclick=${()=>this.interaction.finish()}>
onclick=${() => this.interaction.finish()}>
${mapp.dictionary.cancel}`)

// Set timeout to for the drawend popup to appear after async onchange event popup.
setTimeout(()=>this.popup({
setTimeout(() => this.popup({
coords: this.interaction.vertices[this.interaction.vertices.length - 1],
content: mapp.utils.html.node`<ul>${menu}`,
autoPan: true
}),100)
}), 100)
}
2 changes: 1 addition & 1 deletion lib/ui/elements/drawing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mapp.utils.merge(mapp.dictionaries, {
draw_line: '線',
create: '作成',
},
es: {
esp: {
draw_point: 'Punto',
draw_position: 'Posición actual',
draw_polygon: 'Polígono',
Expand Down
32 changes: 16 additions & 16 deletions lib/ui/layers/listview.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mapp.utils.merge(mapp.dictionaries, {
ja: {
layer_group_hide_layers: 'グループからレイヤーを隠す',
},
es: {
esp: {
layer_group_hide_layers: 'Ocultar todas las capas del grupo',
},
tr: {
Expand All @@ -34,7 +34,7 @@ mapp.utils.merge(mapp.dictionaries, {
}
})

export default function (params){
export default function (params) {

if (!params.mapview) return

Expand All @@ -49,7 +49,7 @@ export default function (params){
Object.values(params.mapview.layers).forEach(layer => add(layer))

// Loop through the layers and add to layers list.
function add(layer){
function add(layer) {

// Do not create a layer view.
if (layer.hidden) return;
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function (params){
const group = {
list: []
}

// Assign layer group to listview object.
listview.groups[layer.group] = group

Expand All @@ -93,14 +93,14 @@ export default function (params){
title=${mapp.dictionary.layer_group_hide_layers}
onclick=${e => {
e.target.style.visibility = 'hidden'
e.target.style.visibility = 'hidden'
group.list
.filter(layer => layer.display)
.forEach(layer => layer.hide())
group.list
.filter(layer => layer.display)
.forEach(layer => layer.hide())
}}>`

}}>`

group.meta = mapp.utils.html.node`<div class="meta">`

group.drawer = mapp.ui.elements.drawer({
Expand All @@ -125,22 +125,22 @@ export default function (params){
group.addLayer = (layer) => {

layer.group = group

if (layer.groupmeta) {
const metaContent = group.meta.appendChild(mapp.utils.html.node`<div>`)
metaContent.innerHTML = layer.groupmeta
}

group.list.push(layer)

group.drawer.appendChild(layer.view)

group.chkVisibleLayer()

layer.showCallbacks.push(()=>group.chkVisibleLayer())
layer.showCallbacks.push(() => group.chkVisibleLayer())

layer.hideCallbacks.push(()=>group.chkVisibleLayer())
layer.hideCallbacks.push(() => group.chkVisibleLayer())
}

}
}
6 changes: 3 additions & 3 deletions lib/ui/layers/panels/dataviews.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mapp.utils.merge(mapp.dictionaries, {
ja: {
layer_dataview_header: 'データビュー',
},
es: {
esp: {
layer_dataview_header: 'Ver los datos',
},
tr: {
Expand Down Expand Up @@ -61,7 +61,7 @@ The dataviews will be decorated with the `mapp.ui.Dataview()` method.
*/

export default function dataviews(layer) {

// Create chkbox controls for each dataview entry.
const dataviewChkboxes = Object.entries(layer.dataviews).map(entry => {

Expand Down Expand Up @@ -113,7 +113,7 @@ export default function dataviews(layer) {
&& dataview.display
&& dataview.show()

layer.showCallbacks.push(()=>{
layer.showCallbacks.push(() => {
dataview.display && dataview.show()
})

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/layers/panels/draw.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mapp.utils.merge(mapp.dictionaries, {
ja: {
layer_add_new_location: '新しいロケーションを追加',
},
es: {
esp: {
layer_add_new_location: 'Agregar nuevos sitios',
},
tr: {
Expand All @@ -40,7 +40,7 @@ export default layer => {

// Do not create the panel.
if (layer.draw.hidden) return;

const elements = Object.keys(layer.draw)
.map(key => {

Expand Down
18 changes: 9 additions & 9 deletions lib/ui/layers/panels/filter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ mapp.utils.merge(mapp.dictionaries, {
layer_filter_less_than: '以下',
layer_filter_set_filter: 'フィルターを設定',
},
es: {
esp: {
layer_filter_header: 'Filtro',
layer_filter_select: 'Seleccionar filtro de la lista',
layer_filter_clear_all: 'Anular todos los filtros',
Expand Down Expand Up @@ -130,9 +130,9 @@ export default layer => {
placeholder: mapp.dictionary.layer_filter_select,
keepPlaceholder: true,
entries: layer.filter.list,
callback: async (e,filter) => {
callback: async (e, filter) => {



// Return if no interface method for the filter type exists.
if (!mapp.ui.layers.filters[filter.type]) return;

Expand All @@ -146,33 +146,33 @@ export default layer => {
filter.remove = () => {

// Delete filter for empty input.
if(layer.filter.current[filter.field]){
if(!layer.filter.current[filter.field][filter.type]){
if (layer.filter.current[filter.field]) {
if (!layer.filter.current[filter.field][filter.type]) {
delete layer.filter.current[filter.field]
}
else{
else {
delete layer.filter.current[filter.field][filter.type]
}
if (layer.filter.current[filter.field] && !Object.keys(layer.filter.current[filter.field]).length) {
delete layer.filter.current[filter.field]
}
}

delete filter.card
e.target.classList.remove('selected')

if (layer.style.legend) {
mapp.ui.layers.legends[layer.style.theme.type](layer)
}

layer.reload();

// The changeEnd event will trigger dataview updates if set.
layer.mapview.Map.getTargetElement().dispatchEvent(new Event('changeEnd'))

// Only show the clearall filter button when filter cards are displayed as children to the filter view.
layer.filter.view.querySelector('[data-id=clearall]').style.display = layer.filter.view.children.length === 3 ? 'none' : 'block';

};

// Get interface content for filter card.
Expand Down
14 changes: 7 additions & 7 deletions lib/ui/layers/panels/style.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mapp.utils.merge(mapp.dictionaries, {
layer_grid_legend_ratio: 'サイズに対する色を比率で表示します',
layer_style_cluster: '多数のロケーション',
},
es: {
esp: {
layer_style_header: 'Estilo',
layer_style_select_theme: 'Seleccionar estilo temático',
layer_style_display_labels: 'Mostrar etiquetas',
Expand Down Expand Up @@ -185,12 +185,12 @@ export default function stylePanel(layer) {
content.push(mapp.ui.elements.dropdown({
placeholder: layer.style.hover.title,
entries: Object.keys(layer.style.hovers)
// Check if that label is set to be hidden.
.filter(key => !layer.style.hovers[key].hidden)
.map(key => ({
title: layer.style.hovers[key].title || key,
option: key
})),
// Check if that label is set to be hidden.
.filter(key => !layer.style.hovers[key].hidden)
.map(key => ({
title: layer.style.hovers[key].title || key,
option: key
})),
callback: (e, entry) => {

const display = layer.style.hover.display
Expand Down
Loading

0 comments on commit d54dda0

Please sign in to comment.