mirror of
https://github.com/Luzifer/mondash.git
synced 2024-11-14 02:12:42 +00:00
Knut Ahlers
f3c31476b4
* Update dependencies * Improve code quality * Apply linter advices * Add gzip compression to all requests * Rework frontend * Apply bootswatch theme * Hide historic details when not requested * Remove debugging header * Apply auto-migration of meta fields * Fix broken "last update" time * Pre-sort metrics for frontend / API * Add tooltip with absolute time * Some design fixes * Add tooltip with absolute date to last ok * Implement filters * Apply eslint --fix * Remove unused var * Remove remains of old template engine * Update baked in assets * Update Dockerfile for new version Signed-off-by: Knut Ahlers <knut@ahlers.me>
97 lines
1.5 KiB
Go
97 lines
1.5 KiB
Go
// Copyright 2013 by Dobrosław Żybort. All rights reserved.
|
||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||
|
||
package slug
|
||
|
||
func init() {
|
||
// Merge language subs with the default one
|
||
for _, sub := range []*map[rune]string{
|
||
&deSub, &enSub, &esSub, &fiSub, &grSub, &nlSub, &plSub,
|
||
} {
|
||
for key, value := range defaultSub {
|
||
(*sub)[key] = value
|
||
}
|
||
}
|
||
}
|
||
|
||
var defaultSub = map[rune]string{
|
||
'"': "",
|
||
'\'': "",
|
||
'’': "",
|
||
'‒': "-", // figure dash
|
||
'–': "-", // en dash
|
||
'—': "-", // em dash
|
||
'―': "-", // horizontal bar
|
||
}
|
||
|
||
var deSub = map[rune]string{
|
||
'&': "und",
|
||
'@': "an",
|
||
'ä': "ae",
|
||
'Ä': "ae",
|
||
'ö': "oe",
|
||
'Ö': "oe",
|
||
'ü': "ue",
|
||
'Ü': "ue",
|
||
}
|
||
|
||
var enSub = map[rune]string{
|
||
'&': "and",
|
||
'@': "at",
|
||
}
|
||
|
||
var esSub = map[rune]string{
|
||
'&': "y",
|
||
'@': "en",
|
||
}
|
||
|
||
var fiSub = map[rune]string{
|
||
'&': "ja",
|
||
'@': "at",
|
||
}
|
||
|
||
var grSub = map[rune]string{
|
||
'&': "kai",
|
||
'η': "i",
|
||
'ή': "i",
|
||
'Η': "i",
|
||
'ι': "i",
|
||
'ί': "i",
|
||
'ϊ': "i",
|
||
'Ι': "i",
|
||
'χ': "x",
|
||
'Χ': "x",
|
||
'ω': "w",
|
||
'ώ': "w",
|
||
'Ω': "w",
|
||
'ϋ': "u",
|
||
}
|
||
|
||
var nlSub = map[rune]string{
|
||
'&': "en",
|
||
'@': "at",
|
||
}
|
||
|
||
var plSub = map[rune]string{
|
||
'&': "i",
|
||
'@': "na",
|
||
}
|
||
|
||
var trSub = map[rune]string{
|
||
'&': "ve",
|
||
'@': "et",
|
||
'ş': "s",
|
||
'Ş': "s",
|
||
'ü': "u",
|
||
'Ü': "u",
|
||
'ö': "o",
|
||
'Ö': "o",
|
||
'İ': "i",
|
||
'ı': "i",
|
||
'ğ': "g",
|
||
'Ğ': "g",
|
||
'ç': "c",
|
||
'Ç': "c",
|
||
}
|