mirror of
https://github.com/miniflux/v2.git
synced 2025-07-22 17:18:37 +00:00
Use unique translation IDs instead of English text as key
This commit is contained in:
parent
f244df6293
commit
beb7a0cfcb
66 changed files with 4069 additions and 2972 deletions
21
locale/parser.go
Normal file
21
locale/parser.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2018 Frédéric Guillot. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package locale // import "miniflux.app/locale"
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type catalogMessages map[string]interface{}
|
||||
type catalog map[string]catalogMessages
|
||||
|
||||
func parseCatalogMessages(data string) (catalogMessages, error) {
|
||||
var translations catalogMessages
|
||||
if err := json.Unmarshal([]byte(data), &translations); err != nil {
|
||||
return nil, fmt.Errorf("invalid translation file: %v", err)
|
||||
}
|
||||
return translations, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue