| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| // Code generated by go-bindata. |
| // sources: |
| // wski18n/resources/de_DE.all.json |
| // wski18n/resources/en_US.all.json |
| // wski18n/resources/es_ES.all.json |
| // wski18n/resources/fr_FR.all.json |
| // wski18n/resources/it_IT.all.json |
| // wski18n/resources/ja_JA.all.json |
| // wski18n/resources/ko_KR.all.json |
| // wski18n/resources/pt_BR.all.json |
| // wski18n/resources/zh_Hans.all.json |
| // wski18n/resources/zh_Hant.all.json |
| // DO NOT EDIT! |
| |
| package wski18n |
| |
| import ( |
| "bytes" |
| "compress/gzip" |
| "fmt" |
| "io" |
| "io/ioutil" |
| "os" |
| "path/filepath" |
| "strings" |
| "time" |
| ) |
| |
| func bindataRead(data []byte, name string) ([]byte, error) { |
| gz, err := gzip.NewReader(bytes.NewBuffer(data)) |
| if err != nil { |
| return nil, fmt.Errorf("Read %q: %v", name, err) |
| } |
| |
| var buf bytes.Buffer |
| _, err = io.Copy(&buf, gz) |
| clErr := gz.Close() |
| |
| if err != nil { |
| return nil, fmt.Errorf("Read %q: %v", name, err) |
| } |
| if clErr != nil { |
| return nil, err |
| } |
| |
| return buf.Bytes(), nil |
| } |
| |
| type asset struct { |
| bytes []byte |
| info os.FileInfo |
| } |
| |
| type bindataFileInfo struct { |
| name string |
| size int64 |
| mode os.FileMode |
| modTime time.Time |
| } |
| |
| func (fi bindataFileInfo) Name() string { |
| return fi.name |
| } |
| func (fi bindataFileInfo) Size() int64 { |
| return fi.size |
| } |
| func (fi bindataFileInfo) Mode() os.FileMode { |
| return fi.mode |
| } |
| func (fi bindataFileInfo) ModTime() time.Time { |
| return fi.modTime |
| } |
| func (fi bindataFileInfo) IsDir() bool { |
| return false |
| } |
| func (fi bindataFileInfo) Sys() interface{} { |
| return nil |
| } |
| |
| var _wski18nResourcesDe_deAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesDe_deAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesDe_deAllJson, |
| "wski18n/resources/de_DE.all.json", |
| ) |
| } |
| |
| func wski18nResourcesDe_deAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesDe_deAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/de_DE.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x98\xdd\x72\xea\x36\x10\xc7\xef\x79\x8a\x1d\xdf\x40\x67\x38\x7e\x80\xd3\x2b\xa6\x65\x0a\xd3\xd3\xc0\x34\xd0\x5c\x34\x9d\x8e\x62\x2d\x58\x13\x23\x39\x2b\x19\x4a\x18\xbf\x7b\x47\x32\x24\x34\xd8\xf8\x03\x87\x72\xae\xc2\x28\xda\xff\xfe\x76\xb5\x92\x56\xfe\xb3\x03\xb0\xeb\x00\x00\x78\x82\x7b\x5f\xc1\x9b\x4b\xf6\x14\x21\x18\x05\x8c\x73\x20\x95\x18\x04\x15\x1b\xa1\xa4\x86\xee\x6e\xe7\xef\x7f\xa7\x69\xd7\xeb\x67\x76\x86\x98\xd4\x11\xb3\xc3\x25\x02\x5f\xe1\x58\xc0\xeb\x00\xa4\xfd\x62\xff\x01\x21\x33\x08\xa3\xd9\x6c\x0a\x84\x2f\x09\x6a\x03\x0b\x45\x30\x9d\xcf\x1c\x89\x93\x4e\xd3\xae\x53\x45\xa2\x34\x2d\x25\x6a\x20\xd9\x10\xf2\x97\x61\xeb\x90\x67\x24\x1b\x42\xfe\x3c\xfc\x36\x9c\x0d\xdb\xe6\x3c\xaf\xda\x74\xd1\x27\xf7\xed\xaf\xfa\x19\xcd\x12\x4c\x16\xc7\x28\x79\xc1\xc6\xb0\x13\xe6\xbf\x7f\xdb\xd7\x7e\x43\xe8\xcb\x3d\x54\xcb\xf4\x21\x21\x56\xce\x0a\x25\x14\x35\xca\x6e\xa9\x4e\x2e\xce\x58\xae\x59\x24\x78\x53\x8a\xca\xe6\xb9\xce\x87\x44\x8a\x00\x65\xa0\xb8\x90\xcb\x37\x91\x27\xc5\xb7\xa5\x9e\xab\xd9\x9e\x71\x2b\xa4\x30\x82\x45\xe2\xf5\xc8\xbc\xa2\xd7\x12\xd3\xb2\xd2\xe5\x1c\x4c\xb8\xdf\x0e\x2c\x31\x21\x4a\x23\x02\xe7\x02\x42\x64\x1c\xa9\x4e\x95\xd6\x11\xcb\x05\x1b\x24\x26\x54\x24\x5e\x33\x9b\x67\xdc\x82\xd0\x20\x95\x81\x40\xc9\x85\x58\x26\x84\x1c\x7a\x5f\xbe\x58\x6d\xfb\x1f\x1b\xae\x20\xe4\x3f\x14\xa0\x35\x96\xcb\x85\xfb\x49\xad\x56\x4c\x72\x58\x30\x11\x21\x07\x9e\x64\x41\xcb\x2c\x5e\x3b\x9a\x10\x16\x90\x54\xb3\xcd\x75\x7b\xa7\x40\x48\x83\xb4\x60\x01\x42\x4c\x6a\x2d\x38\xf2\x1f\x41\xaa\xc3\x19\xa6\x63\x25\x35\xba\x6a\x03\xfc\x27\xc6\xc0\x20\x2f\xc0\x68\xa6\x55\x2f\x1b\xce\x81\x64\x51\xd3\x8c\x9c\xd8\xe7\xba\x9f\x85\x08\x0b\x15\x45\x6a\x63\xeb\x9e\xc5\x71\x74\xa8\x34\x74\xdb\x62\xc3\xec\x7a\x06\x28\xd6\xc8\x4b\x4b\xb8\xa1\xd8\xed\x1d\x62\x37\xbb\xb1\xdf\xb5\x6c\x40\x31\x23\x9d\xdd\x54\x6b\x24\x2d\x94\xac\x77\xc9\x54\x90\xb8\xb0\x51\x6b\x7a\xef\x55\x17\x6c\x0e\xd8\x0e\x55\x75\x94\xa7\x44\x44\xff\xa9\xc7\x1a\x00\xe7\x6c\xab\x65\xc0\x26\xf0\x84\xff\xb2\xd6\xaf\x8e\x64\x35\x48\xfb\x62\x68\x19\xb2\x8e\x64\x35\xc8\x7d\x27\xde\x32\x67\x4d\xd5\x8a\xf9\xb4\xbd\x78\xdb\x09\xad\xa3\x59\x70\xb2\xef\x2f\x26\x77\x29\xf8\x70\x38\xaa\xb5\x61\x6f\xaf\x5a\x27\xe8\x06\xd2\xb4\xeb\xc3\x1f\x6e\xc2\xa1\x6d\x67\x84\xf0\xe8\xb1\xc0\x88\x35\x3e\x7a\x60\x6f\xbf\x47\x4f\xc8\xc3\x80\x5f\x78\x25\x7c\xb6\xdf\x92\x55\xc9\xce\xda\xc3\x4d\xd4\x60\x09\x4a\x05\xca\x00\x48\x05\xa8\xb5\x53\x78\x49\x90\xb6\x05\x2f\xa1\x3a\x48\xf5\x25\x73\x21\x77\x3b\x7f\xa5\x97\x69\x0a\xbd\x40\x71\xb4\x93\xed\xdf\x34\x2d\x6a\x49\x8b\xe7\x17\xb6\x39\x81\x92\x12\x03\xb7\xca\x59\xb3\xd4\x07\x45\x60\xc4\x0a\x39\xa8\xc4\xf8\xd0\x73\x65\x6d\x57\x3f\xd1\x50\x0d\xe3\x72\xdd\x5c\xdc\x49\x8c\xf2\x21\x14\xfa\x19\x06\xd3\xb1\xcb\xad\xd0\xb0\x12\x5a\xdb\xbe\xaa\x37\x8d\x90\x69\x7c\x6f\xbe\xe1\x61\x34\xbe\xff\xf5\xef\xc1\x74\x3c\xb2\x9b\x53\x48\xf0\x37\xfa\x39\x26\x15\x6b\x48\x24\x47\x72\x4d\x87\xde\x6a\x83\x2b\x18\x4d\x7e\x1b\x02\x17\x84\x81\x51\xb4\xf5\x8b\x02\xbb\x26\x41\x1b\x29\xd8\xd8\xa9\x3e\x8b\x85\x1f\x2a\x6d\xfc\x98\x94\x51\xfd\x8f\xa3\x92\xad\xd0\x6d\xdb\x8f\xb3\x15\x19\x0b\x9d\x0d\x5b\x6c\x24\x23\xf0\x98\x7d\x32\x1d\xde\x65\x41\x7e\x4e\x02\xff\x47\xfe\xb3\xed\xf7\x69\x18\x57\x29\xbf\xab\xb9\xbf\x38\xf8\x9b\x2b\xbc\xef\x04\xbe\xf0\xbb\xc5\xd1\x9b\x68\xff\xa5\xa1\x78\xd7\x0c\xe6\xb3\x51\x3b\x05\x77\x0d\xcf\xad\x84\x6c\x50\x1b\x21\x97\xbe\xfb\xd8\xc2\xb4\x73\x18\x33\x13\x82\x5a\xb8\xdf\xec\x54\x6f\x21\x22\x6c\xbb\xca\x6e\x1e\xdb\x26\xbb\xf3\x57\xe7\xdf\x00\x00\x00\xff\xff\x69\x9f\x4a\x63\x8b\x19\x00\x00") |
| |
| func wski18nResourcesEn_usAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesEn_usAllJson, |
| "wski18n/resources/en_US.all.json", |
| ) |
| } |
| |
| func wski18nResourcesEn_usAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesEn_usAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/en_US.all.json", size: 6539, mode: os.FileMode(420), modTime: time.Unix(1503611107, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesEs_esAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesEs_esAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesEs_esAllJson, |
| "wski18n/resources/es_ES.all.json", |
| ) |
| } |
| |
| func wski18nResourcesEs_esAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesEs_esAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/es_ES.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesFr_frAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesFr_frAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesFr_frAllJson, |
| "wski18n/resources/fr_FR.all.json", |
| ) |
| } |
| |
| func wski18nResourcesFr_frAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesFr_frAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/fr_FR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesIt_itAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesIt_itAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesIt_itAllJson, |
| "wski18n/resources/it_IT.all.json", |
| ) |
| } |
| |
| func wski18nResourcesIt_itAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesIt_itAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/it_IT.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesJa_jaAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesJa_jaAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesJa_jaAllJson, |
| "wski18n/resources/ja_JA.all.json", |
| ) |
| } |
| |
| func wski18nResourcesJa_jaAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesJa_jaAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/ja_JA.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesKo_krAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesKo_krAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesKo_krAllJson, |
| "wski18n/resources/ko_KR.all.json", |
| ) |
| } |
| |
| func wski18nResourcesKo_krAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesKo_krAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/ko_KR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesPt_brAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesPt_brAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesPt_brAllJson, |
| "wski18n/resources/pt_BR.all.json", |
| ) |
| } |
| |
| func wski18nResourcesPt_brAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesPt_brAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/pt_BR.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesZh_hansAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesZh_hansAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesZh_hansAllJson, |
| "wski18n/resources/zh_Hans.all.json", |
| ) |
| } |
| |
| func wski18nResourcesZh_hansAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesZh_hansAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/zh_Hans.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesZh_hantAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00") |
| |
| func wski18nResourcesZh_hantAllJsonBytes() ([]byte, error) { |
| return bindataRead( |
| _wski18nResourcesZh_hantAllJson, |
| "wski18n/resources/zh_Hant.all.json", |
| ) |
| } |
| |
| func wski18nResourcesZh_hantAllJson() (*asset, error) { |
| bytes, err := wski18nResourcesZh_hantAllJsonBytes() |
| if err != nil { |
| return nil, err |
| } |
| |
| info := bindataFileInfo{name: "wski18n/resources/zh_Hant.all.json", size: 0, mode: os.FileMode(420), modTime: time.Unix(1500156160, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| // Asset loads and returns the asset for the given name. |
| // It returns an error if the asset could not be found or |
| // could not be loaded. |
| func Asset(name string) ([]byte, error) { |
| cannonicalName := strings.Replace(name, "\\", "/", -1) |
| if f, ok := _bindata[cannonicalName]; ok { |
| a, err := f() |
| if err != nil { |
| return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) |
| } |
| return a.bytes, nil |
| } |
| return nil, fmt.Errorf("Asset %s not found", name) |
| } |
| |
| // MustAsset is like Asset but panics when Asset would return an error. |
| // It simplifies safe initialization of global variables. |
| func MustAsset(name string) []byte { |
| a, err := Asset(name) |
| if err != nil { |
| panic("asset: Asset(" + name + "): " + err.Error()) |
| } |
| |
| return a |
| } |
| |
| // AssetInfo loads and returns the asset info for the given name. |
| // It returns an error if the asset could not be found or |
| // could not be loaded. |
| func AssetInfo(name string) (os.FileInfo, error) { |
| cannonicalName := strings.Replace(name, "\\", "/", -1) |
| if f, ok := _bindata[cannonicalName]; ok { |
| a, err := f() |
| if err != nil { |
| return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) |
| } |
| return a.info, nil |
| } |
| return nil, fmt.Errorf("AssetInfo %s not found", name) |
| } |
| |
| // AssetNames returns the names of the assets. |
| func AssetNames() []string { |
| names := make([]string, 0, len(_bindata)) |
| for name := range _bindata { |
| names = append(names, name) |
| } |
| return names |
| } |
| |
| // _bindata is a table, holding each asset generator, mapped to its name. |
| var _bindata = map[string]func() (*asset, error){ |
| "wski18n/resources/de_DE.all.json": wski18nResourcesDe_deAllJson, |
| "wski18n/resources/en_US.all.json": wski18nResourcesEn_usAllJson, |
| "wski18n/resources/es_ES.all.json": wski18nResourcesEs_esAllJson, |
| "wski18n/resources/fr_FR.all.json": wski18nResourcesFr_frAllJson, |
| "wski18n/resources/it_IT.all.json": wski18nResourcesIt_itAllJson, |
| "wski18n/resources/ja_JA.all.json": wski18nResourcesJa_jaAllJson, |
| "wski18n/resources/ko_KR.all.json": wski18nResourcesKo_krAllJson, |
| "wski18n/resources/pt_BR.all.json": wski18nResourcesPt_brAllJson, |
| "wski18n/resources/zh_Hans.all.json": wski18nResourcesZh_hansAllJson, |
| "wski18n/resources/zh_Hant.all.json": wski18nResourcesZh_hantAllJson, |
| } |
| |
| // AssetDir returns the file names below a certain |
| // directory embedded in the file by go-bindata. |
| // For example if you run go-bindata on data/... and data contains the |
| // following hierarchy: |
| // data/ |
| // foo.txt |
| // img/ |
| // a.png |
| // b.png |
| // then AssetDir("data") would return []string{"foo.txt", "img"} |
| // AssetDir("data/img") would return []string{"a.png", "b.png"} |
| // AssetDir("foo.txt") and AssetDir("notexist") would return an error |
| // AssetDir("") will return []string{"data"}. |
| func AssetDir(name string) ([]string, error) { |
| node := _bintree |
| if len(name) != 0 { |
| cannonicalName := strings.Replace(name, "\\", "/", -1) |
| pathList := strings.Split(cannonicalName, "/") |
| for _, p := range pathList { |
| node = node.Children[p] |
| if node == nil { |
| return nil, fmt.Errorf("Asset %s not found", name) |
| } |
| } |
| } |
| if node.Func != nil { |
| return nil, fmt.Errorf("Asset %s not found", name) |
| } |
| rv := make([]string, 0, len(node.Children)) |
| for childName := range node.Children { |
| rv = append(rv, childName) |
| } |
| return rv, nil |
| } |
| |
| type bintree struct { |
| Func func() (*asset, error) |
| Children map[string]*bintree |
| } |
| var _bintree = &bintree{nil, map[string]*bintree{ |
| "wski18n": &bintree{nil, map[string]*bintree{ |
| "resources": &bintree{nil, map[string]*bintree{ |
| "de_DE.all.json": &bintree{wski18nResourcesDe_deAllJson, map[string]*bintree{}}, |
| "en_US.all.json": &bintree{wski18nResourcesEn_usAllJson, map[string]*bintree{}}, |
| "es_ES.all.json": &bintree{wski18nResourcesEs_esAllJson, map[string]*bintree{}}, |
| "fr_FR.all.json": &bintree{wski18nResourcesFr_frAllJson, map[string]*bintree{}}, |
| "it_IT.all.json": &bintree{wski18nResourcesIt_itAllJson, map[string]*bintree{}}, |
| "ja_JA.all.json": &bintree{wski18nResourcesJa_jaAllJson, map[string]*bintree{}}, |
| "ko_KR.all.json": &bintree{wski18nResourcesKo_krAllJson, map[string]*bintree{}}, |
| "pt_BR.all.json": &bintree{wski18nResourcesPt_brAllJson, map[string]*bintree{}}, |
| "zh_Hans.all.json": &bintree{wski18nResourcesZh_hansAllJson, map[string]*bintree{}}, |
| "zh_Hant.all.json": &bintree{wski18nResourcesZh_hantAllJson, map[string]*bintree{}}, |
| }}, |
| }}, |
| }} |
| |
| // RestoreAsset restores an asset under the given directory |
| func RestoreAsset(dir, name string) error { |
| data, err := Asset(name) |
| if err != nil { |
| return err |
| } |
| info, err := AssetInfo(name) |
| if err != nil { |
| return err |
| } |
| err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) |
| if err != nil { |
| return err |
| } |
| err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) |
| if err != nil { |
| return err |
| } |
| err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) |
| if err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| // RestoreAssets restores an asset under the given directory recursively |
| func RestoreAssets(dir, name string) error { |
| children, err := AssetDir(name) |
| // File |
| if err != nil { |
| return RestoreAsset(dir, name) |
| } |
| // Dir |
| for _, child := range children { |
| err = RestoreAssets(dir, filepath.Join(name, child)) |
| if err != nil { |
| return err |
| } |
| } |
| return nil |
| } |
| |
| func _filePath(dir, name string) string { |
| cannonicalName := strings.Replace(name, "\\", "/", -1) |
| return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) |
| } |
| |