Change TranslationEditor to handle fonts spec
This commit is contained in:
@@ -48,8 +48,8 @@
|
|||||||
} else if (id == "current-lang-file") {
|
} else if (id == "current-lang-file") {
|
||||||
if (checkTranslationFile(file.name)) {
|
if (checkTranslationFile(file.name)) {
|
||||||
app.current = json;
|
app.current = json;
|
||||||
if (!app.current.cyrillicGlyphs){
|
if (!app.current.fonts){
|
||||||
app.current.cyrillicGlyphs = false;
|
app.current.fonts = ["ascii_basic"];
|
||||||
}
|
}
|
||||||
app.meta.currentLoaded = true;
|
app.meta.currentLoaded = true;
|
||||||
}
|
}
|
||||||
@@ -137,6 +137,7 @@
|
|||||||
loaded: false,
|
loaded: false,
|
||||||
},
|
},
|
||||||
obsolete : {},
|
obsolete : {},
|
||||||
|
fontToAdd: "latin_extended",
|
||||||
},
|
},
|
||||||
methods : {
|
methods : {
|
||||||
validateInput: function(valMap, id, mode) {
|
validateInput: function(valMap, id, mode) {
|
||||||
@@ -246,7 +247,15 @@
|
|||||||
} else {
|
} else {
|
||||||
valMap[id] = message;
|
valMap[id] = message;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
removeFont: function(i) {
|
||||||
|
this.current.fonts.splice(i, 1);
|
||||||
|
},
|
||||||
|
|
||||||
|
addFont: function() {
|
||||||
|
this.current.fonts.push(this.fontToAdd);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.def = def;
|
app.def = def;
|
||||||
@@ -289,12 +298,20 @@
|
|||||||
<td class="value"><input type="text" v-model="current.languageLocalName" class="short"></td>
|
<td class="value"><input type="text" v-model="current.languageLocalName" class="short"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="meta.currentLoaded">
|
<tr v-if="meta.currentLoaded">
|
||||||
<td class="label">Font table to use</td>
|
<td class="label">Font tables to use<br>("ascii_basic" must be first)</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
<select v-model="current.cyrillicGlyphs" v-on:change="current.cyrillicGlyphs = current.cyrillicGlyphs=='true'">
|
<ul>
|
||||||
<option value="false">Latin Extended</option>
|
<li v-for="(font, i) in current.fonts">
|
||||||
<option value="true">Cyrillic Glyphs</option>
|
<button type="button" @click="removeFont(i)" :disabled="i == 0 && font == 'ascii_basic'">-</button> {{ font }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<select v-model="fontToAdd">
|
||||||
|
<!-- <option value="ascii_basic">ascii_basic: ASCII Basic</option> -->
|
||||||
|
<option value="latin_extended">latin_extended: Latin Extended</option>
|
||||||
|
<option value="cyrillic">cyrillic: Cyrillic Glyphs</option>
|
||||||
|
<option value="cjk">cjk: Chinese/Japanese/Korean</option>
|
||||||
</select>
|
</select>
|
||||||
|
<button type="button" @click="addFont()">Add</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user