| /* |
| * 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(1506031186, 0)} |
| a := &asset{bytes: bytes, info: info} |
| return a, nil |
| } |
| |
| var _wski18nResourcesEn_usAllJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x98\x51\x6f\xdb\x36\x10\xc7\xdf\xfd\x29\x0e\x7a\x71\x06\xb8\xfa\x00\xdd\x53\xb0\x19\x73\xb0\xae\x31\x56\x67\x7d\x58\x86\x81\x16\xcf\xd6\x21\x12\xc9\x92\x94\x3d\xd7\xd0\x77\x1f\x48\xd9\xb5\xd7\x48\x96\x44\x2b\x59\x9e\x62\x30\xbc\xff\xfd\x78\x3c\x1e\x8f\xfa\x73\x04\xb0\x1f\x01\x00\x44\xc4\xa3\xf7\x10\x3d\x08\xb6\xcc\x10\xac\x04\xc6\x39\x68\x59\x58\x04\xa9\x2c\x49\x61\x60\xbc\xdf\xc7\x87\xdf\x65\x39\x8e\x26\x95\x9d\xd5\x4c\x98\x8c\xb9\xe1\x16\x81\xf7\x70\x2e\x10\x8d\x00\xca\x49\xb3\xff\x44\x23\xb3\x08\xb3\xc5\x62\x0e\x1a\xbf\x14\x68\x2c\xac\xa4\x86\xf9\xc3\xc2\x93\x78\xe9\xb2\x1c\x7b\x55\xd4\xba\x2c\x5b\x89\x02\x24\x03\x21\x7f\x99\x0e\x0e\x79\x41\x32\x10\xf2\xe7\xe9\x87\xe9\x62\x3a\x34\xe7\x65\xd5\xd0\x4d\xbf\xff\x34\xfc\xae\x5f\xd0\x6c\xc1\x64\x4a\xa1\xe0\x0d\x07\xc3\x4d\x78\xf8\xfd\xc3\x21\xf7\x03\xa1\xaf\xf7\xd0\x2d\xd2\xc7\x80\x38\x39\x27\x54\xe8\x2c\x28\xba\xad\x3a\xb5\x38\x77\x62\xc3\x32\xe2\xa1\x14\x9d\xcd\x6b\x9d\x4f\xb5\x96\x1a\x50\x24\x92\x93\x58\x7f\x13\x59\x4a\xbe\x6b\xf5\xdc\xcd\xf6\x82\x5b\x12\x64\x89\x65\xf4\xf5\xcc\xbc\xa3\xd7\x16\xd3\xb6\xd4\xe5\x1c\x6c\x7a\x38\x0e\xac\xb0\x29\x0a\x4b\x89\x77\x01\x29\x32\x8e\xba\x4f\x96\xf6\x11\xab\x05\xbb\x2d\x6c\x2a\x35\x7d\xad\x6c\x9e\x70\x07\x64\x40\x48\x0b\x89\x14\x2b\x5a\x17\x1a\x39\xdc\xbc\x7b\xe7\xb4\xdd\x7f\xdc\x72\x49\x23\xff\xa1\x01\x2d\x58\xae\x1e\x4e\xc0\xed\xfc\x0e\x52\x69\x2c\xe4\x85\xdb\x5f\x04\xa5\xe5\x86\x38\xf2\xf8\x51\x34\x31\xb4\x58\x75\xd8\xa0\xd7\xbf\x77\x7f\x92\x79\xce\x04\x87\x15\xa3\x0c\x39\xf0\xa2\x92\x12\xd5\xd6\xba\xd1\x42\x63\x83\xeb\x6e\xb6\xb5\x6e\x3f\x4a\x20\x61\x51\xaf\x58\x72\x0a\xd2\x8f\x20\xe4\xb1\x5c\x1b\x25\x85\x41\x7f\xb0\x00\xff\x51\x98\x58\xe4\x0d\x18\x61\x5a\xfd\xa2\xe1\x1d\x08\x96\x85\x46\xe4\x99\x7d\xad\xfb\x45\x8a\xb0\x92\x59\x26\xb7\xee\x88\x33\xa5\xb2\xe3\xa1\x42\x5f\x01\xb6\xcc\xa5\x6e\x82\xb4\x41\xde\x7a\x5a\x03\xc5\xde\x5e\xbd\x7e\xb3\x35\xec\xa4\xe5\x16\xa4\x98\x36\xd5\xa5\xbc\x41\x6d\x48\x8a\x7e\xf7\x69\x07\x89\x2b\x7b\xd2\xd0\x2b\xbe\xbb\x60\x38\xe0\x30\x54\xdd\x51\x96\x05\x65\xff\xc9\xc7\x1e\x00\x97\x6c\xbb\x45\xc0\x05\xf0\x19\xff\x75\x5d\x6e\x1f\xc9\x6e\x90\xee\x71\x34\x30\x64\x1f\xc9\x6e\x90\x87\x47\xc7\xc0\x9c\x3d\x55\x3b\xc6\xd3\x3d\x3b\x86\x0e\x68\x1f\xcd\x86\xca\x7e\xb8\x98\xfc\xa5\x10\xc3\xb1\x54\x1b\xcb\xbe\x35\x12\x5e\xd0\x0f\x94\xe5\x38\x86\x3f\xfc\x84\x63\x93\xc2\x34\xc2\x63\xc4\x12\x4b\x1b\x7c\x8c\xc0\xdd\x7e\x8f\x11\x89\xe3\x40\xdc\x78\x25\xbc\xb4\xdf\x96\x5d\xa9\x6a\xed\xf1\x26\x0a\xd8\x82\x56\x81\x36\x00\x2d\x13\x34\xc6\x2b\x7c\x29\x50\xef\x1a\xfa\xbe\x3e\x48\xfd\x25\x6b\x21\xf7\xfb\x38\x37\xeb\xb2\x84\x9b\x44\x72\x74\x93\xdd\xdf\xb2\x6c\xea\xbe\x9b\xe7\x37\xb6\x39\x89\x14\x02\x13\xbf\xcb\x55\xb3\x34\x01\xa9\xc1\x52\x8e\x1c\x64\x61\x63\xb8\xf1\x69\xed\x76\xbf\x30\xd0\x0d\xe3\x7a\xdd\xde\x6f\xe7\x09\x2c\x31\x61\x85\x41\xb8\x57\x28\x3e\xa7\x64\x9e\x4e\x8f\x00\x32\x90\x93\x31\x24\xd6\x01\xaf\xe9\xae\xca\x57\x20\xbb\xee\x87\x29\xaa\x24\x5d\x86\xb8\x1f\x65\x39\x76\xf2\x54\x9d\xc7\xab\x3e\x08\x84\x7a\xaa\x5d\xd2\xc5\x28\xc0\xcd\x3c\x43\x66\xf0\xf4\xdc\x83\xcf\xb3\xbb\x4f\xbf\xfe\x7d\x3b\xbf\x9b\xb9\x1a\x49\x02\xe2\xad\x79\x52\x5a\x2a\x03\x85\xe0\xa8\x3d\x93\xd9\x19\x8b\x39\xcc\xee\x7f\x9b\x02\x27\x8d\x89\x95\x7a\x17\x37\xe5\xd7\xab\x22\x0c\x12\x84\xad\x9b\x1b\x33\x45\x3e\xe0\xb1\xd2\xd2\xca\xc9\xf7\xa3\x82\xe5\xe8\xeb\xe7\xf7\xb3\xa5\xb6\x8e\xba\x1a\x76\xdc\xa8\x2d\xe1\x39\xfc\xfd\x7c\xfa\xb1\x5a\xe5\x0b\x85\xf0\x7f\x5c\x40\xe3\x67\x8b\xb3\x77\xc2\xe1\x43\x43\x33\xff\xed\xc3\x62\x36\x4c\xf2\xbd\x86\xe7\x41\x96\x6c\xd1\x58\x12\xeb\xd8\x7f\x6b\x61\xc6\x3b\x54\xcc\xa6\x20\x57\x55\x1d\x78\xae\xb7\xa2\x0c\x87\xce\xb4\x37\x8f\xed\x82\x3d\xfa\x6b\xf4\x6f\x00\x00\x00\xff\xff\xc3\xb5\x3e\xea\x8a\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: 6538, mode: os.FileMode(420), modTime: time.Unix(1506031828, 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(1506031186, 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(1506031186, 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(1506031186, 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(1506031186, 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(1506031186, 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(1506031186, 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(1506031186, 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(1506031186, 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, "/")...)...) |
| } |
| |