123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- // Copyright 2013 The Go Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file.
- package cldr
- // This file contains test data.
- import (
- "io"
- "strings"
- )
- type testLoader struct {
- }
- func (t testLoader) Len() int {
- return len(testFiles)
- }
- func (t testLoader) Path(i int) string {
- return testPaths[i]
- }
- func (t testLoader) Reader(i int) (io.ReadCloser, error) {
- return &reader{*strings.NewReader(testFiles[i])}, nil
- }
- // reader adds a dummy Close method to strings.Reader so that it
- // satisfies the io.ReadCloser interface.
- type reader struct {
- strings.Reader
- }
- func (r reader) Close() error {
- return nil
- }
- var (
- testFiles = []string{de_xml, gsw_xml, root_xml}
- testPaths = []string{
- "common/main/de.xml",
- "common/main/gsw.xml",
- "common/main/root.xml",
- }
- )
- var root_xml = `<?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
- <ldml>
- <identity>
- <language type="root"/>
- <generation date="now"/>
- </identity>
- <characters>
- <exemplarCharacters>[]</exemplarCharacters>
- <exemplarCharacters type="auxiliary">[]</exemplarCharacters>
- <exemplarCharacters type="punctuation">[\- ‐ – — … ' ‘ ‚ " “ „ \& #]</exemplarCharacters>
- <ellipsis type="final">{0}…</ellipsis>
- <ellipsis type="initial">…{0}</ellipsis>
- <moreInformation>?</moreInformation>
- </characters>
- <dates>
- <calendars>
- <default choice="gregorian"/>
- <calendar type="buddhist">
- <months>
- <alias source="locale" path="../../calendar[@type='gregorian']/months"/>
- </months>
- </calendar>
- <calendar type="chinese">
- <months>
- <alias source="locale" path="../../calendar[@type='gregorian']/months"/>
- </months>
- </calendar>
- <calendar type="gregorian">
- <months>
- <default choice="format"/>
- <monthContext type="format">
- <default choice="wide"/>
- <monthWidth type="narrow">
- <alias source="locale" path="../../monthContext[@type='stand-alone']/monthWidth[@type='narrow']"/>
- </monthWidth>
- <monthWidth type="wide">
- <month type="1">11</month>
- <month type="2">22</month>
- <month type="3">33</month>
- <month type="4">44</month>
- </monthWidth>
- </monthContext>
- <monthContext type="stand-alone">
- <monthWidth type="narrow">
- <month type="1">1</month>
- <month type="2">2</month>
- <month type="3">3</month>
- <month type="4">4</month>
- </monthWidth>
- <monthWidth type="wide">
- <alias source="locale" path="../../monthContext[@type='format']/monthWidth[@type='wide']"/>
- </monthWidth>
- </monthContext>
- </months>
- </calendar>
- </calendars>
- </dates>
- </ldml>
- `
- var de_xml = `<?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
- <ldml>
- <identity>
- <language type="de"/>
- </identity>
- <characters>
- <exemplarCharacters>[a ä b c d e ö p q r s ß t u ü v w x y z]</exemplarCharacters>
- <exemplarCharacters type="auxiliary">[á à ă]</exemplarCharacters>
- <exemplarCharacters type="index">[A B C D E F G H Z]</exemplarCharacters>
- <ellipsis type="final">{0} …</ellipsis>
- <ellipsis type="initial">… {0}</ellipsis>
- <moreInformation>?</moreInformation>
- <stopwords>
- <stopwordList type="collation" draft="provisional">der die das</stopwordList>
- </stopwords>
- </characters>
- <dates>
- <calendars>
- <calendar type="buddhist">
- <months>
- <monthContext type="format">
- <monthWidth type="narrow">
- <month type="3">BBB</month>
- </monthWidth>
- <monthWidth type="wide">
- <month type="3">bbb</month>
- </monthWidth>
- </monthContext>
- </months>
- </calendar>
- <calendar type="gregorian">
- <months>
- <monthContext type="format">
- <monthWidth type="narrow">
- <month type="3">M</month>
- <month type="4">A</month>
- </monthWidth>
- <monthWidth type="wide">
- <month type="3">Maerz</month>
- <month type="4">April</month>
- <month type="5">Mai</month>
- </monthWidth>
- </monthContext>
- <monthContext type="stand-alone">
- <monthWidth type="narrow">
- <month type="3">m</month>
- <month type="5">m</month>
- </monthWidth>
- <monthWidth type="wide">
- <month type="4">april</month>
- <month type="5">mai</month>
- </monthWidth>
- </monthContext>
- </months>
- </calendar>
- </calendars>
- </dates>
- <posix>
- <messages>
- <yesstr>yes:y</yesstr>
- <nostr>no:n</nostr>
- </messages>
- </posix>
- </ldml>
- `
- var gsw_xml = `<?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
- <ldml>
- <identity>
- <language type="gsw"/>
- </identity>
- <posix>
- <alias source="de" path="//ldml/posix"/>
- </posix>
- </ldml>
- `
|