diff --git a/cmd/datasheet-converter/main.go b/cmd/datasheet-converter/main.go index 1554909..f6ace41 100644 --- a/cmd/datasheet-converter/main.go +++ b/cmd/datasheet-converter/main.go @@ -297,7 +297,7 @@ func normalizeCellValue(column datasheet.Column, str string) any { return nil } - // ugly rounding fix + //ugly rounding fix pow := math.Pow(10, 6) return math.Round(val*pow) / pow } diff --git a/localization/localization.go b/localization/localization.go index 91f13cd..e142e6a 100644 --- a/localization/localization.go +++ b/localization/localization.go @@ -46,13 +46,24 @@ func New(root string) (*internal.Store[string], error) { return nil, err } + var isLegacyFile bool + var resources Resources err = xml.NewDecoder(xmlFile).Decode(&resources) if err != nil { - return nil, err + if strings.Contains(err.Error(), "expected element type") { + isLegacyFile = true + } + if !isLegacyFile { + return nil, err + } } xmlFile.Close() + if isLegacyFile { + continue + } + for _, resource := range resources.Strings { if resource.Nil { continue