2016-12-14 15:18:11 +08:00
// Code generated by go-bindata.
// sources:
2016-12-25 13:09:03 +08:00
// translations/extract.py
2017-01-10 22:32:43 +08:00
// translations/kubectl/default/LC_MESSAGES/k8s.mo
// translations/kubectl/default/LC_MESSAGES/k8s.po
// translations/kubectl/en_US/LC_MESSAGES/k8s.mo
// translations/kubectl/en_US/LC_MESSAGES/k8s.po
// translations/test/default/LC_MESSAGES/k8s.mo
// translations/test/default/LC_MESSAGES/k8s.po
// translations/test/en_US/LC_MESSAGES/k8s.mo
// translations/test/en_US/LC_MESSAGES/k8s.po
2016-12-14 15:18:11 +08:00
// DO NOT EDIT!
package generated
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
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
}
2016-12-25 13:09:03 +08:00
var _translationsExtractPy = [ ] byte ( ` # ! / usr / bin / python
"" " Extract strings from command files and externalize into translation files .
Expects to be run from the root directory of the repository .
Usage :
extract . py pkg / kubectl / cmd / apply . go
"" "
import fileinput
import sys
import re
class MatchHandler ( object ) :
"" " Simple holder for a regular expression and a function
to run if that regular expression matches a line .
The function should expect ( re . match , file , linenumber ) as parameters
"" "
def __init__ ( self , regex , replace_fn ) :
self . regex = re . compile ( regex )
self . replace_fn = replace_fn
# global holding all strings discovered
STRINGS = [ ]
def short_replace ( match , file , line_number ) :
"" " Replace a Short : ... cobra command description with an internationalization
"" "
sys . stdout . write ( ' { } i18n . T ( { } ) , \ n ' . format ( match . group ( 1 ) , match . group ( 2 ) ) )
STRINGS . append ( ( match . group ( 2 ) , file , line_number ) )
SHORT_MATCH = MatchHandler ( r ' ( \ s + Short : \ s + ) ( "[^" ] + " ) , ' , short_replace )
def import_replace ( match , file , line_number ) :
"" " Add an extra import for the i18n library .
Doesn ' t try to be smart and detect if it ' s already present , assumes a
gofmt round wil fix things .
"" "
sys . stdout . write ( ' { } \ n "k8s.io/kubernetes/pkg/util/i18n" \ n ' . format ( match . group ( 1 ) ) )
IMPORT_MATCH = MatchHandler ( ' ( . * "k8s.io/kubernetes/pkg/kubectl/cmd/util" ) ' , import_replace )
def replace ( filename , matchers ) :
"" " Given a file and a set of matchers , run those matchers
across the file and replace it with the results .
"" "
# Run all the matchers
line_number = 0
for line in fileinput . input ( filename , inplace = True ) :
line_number += 1
matched = False
for matcher in matchers :
match = matcher . regex . match ( line )
if match :
matcher . replace_fn ( match , filename , line_number )
matched = True
break
if not matched :
sys . stdout . write ( line )
sys . stdout . flush ( )
# gofmt the file again
from subprocess import call
call ( [ "gofmt" , "-s" , "-w" , filename ] )
# update the translation files
translation_files = [
"translations/kubectl/default/LC_MESSAGES/k8s.po" ,
"translations/kubectl/en_US/LC_MESSAGES/k8s.po" ,
]
for translation_filename in translation_files :
with open ( translation_filename , "a" ) as tfile :
for translation_string in STRINGS :
msg_string = translation_string [ 0 ]
tfile . write ( '\n' )
tfile . write ( ' # https : //github.com/kubernetes/kubernetes/blob/master{}#L{}\n'.format(translation_string[1], translation_string[2]))
tfile . write ( ' msgctxt { } \ n ' . format ( msg_string ) )
tfile . write ( ' msgid { } \ n ' . format ( msg_string ) )
tfile . write ( ' msgstr { } \ n ' . format ( msg_string ) )
replace ( sys . argv [ 1 ] , [ SHORT_MATCH , IMPORT_MATCH ] )
` )
func translationsExtractPyBytes ( ) ( [ ] byte , error ) {
return _translationsExtractPy , nil
}
func translationsExtractPy ( ) ( * asset , error ) {
bytes , err := translationsExtractPyBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/extract.py" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsKubectlDefaultLc_messagesK8sMo = [ ] byte ( "\xde\x12\x04\x95\x00\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x004\x00\x00\x00\x05\x00\x00\x00L\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00I\x00\x00\x00a\x00\x00\x00(\x01\x00\x00\xab\x00\x00\x00\xac\x01\x00\x00\xd4\x01\x00\x00$\x00\x00\x00\x81\x03\x00\x00\xc3\x00\x00\x00\xa6\x03\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00Update the annotations on a resource\x04Update the annotations on a resource\x00watch is only supported on individual resources and resource collections - %d resources were found\x04watch is only supported on individual resources and resource collections - %d resources were found\x00watch is only supported on individual resources and resource collections - %d resources were found\x00Project-Id-Version: gettext-go-examples-hello\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2013-12-12 20:03+0000\nPO-Revision-Date: 2016-12-13 21:54-0800\nLast-Translator: Brendan Burns <brendan.d.burns@gmail.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: Poedit 1.6.10\nX-Poedit-SourceCharset: UTF-8\nLanguage-Team: \nPlural-Forms: nplurals=2; plural=(n != 1);\nLanguage: en\n\x00Update the annotations on a resource\x00watch is only supported on individual resources and resource collections - %d resource was found\x00watch is only supported on individual resources and resource collections - %d resources were found\x00" )
2016-12-14 15:18:11 +08:00
func translationsKubectlDefaultLc_messagesK8sMoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsKubectlDefaultLc_messagesK8sMo , nil
2016-12-14 15:18:11 +08:00
}
func translationsKubectlDefaultLc_messagesK8sMo ( ) ( * asset , error ) {
bytes , err := translationsKubectlDefaultLc_messagesK8sMoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/kubectl/default/LC_MESSAGES/k8s.mo" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsKubectlDefaultLc_messagesK8sPo = [ ] byte ( ` # Test translations for unit tests .
# Copyright ( C ) 2016
# This file is distributed under the same license as the PACKAGE package .
# FIRST AUTHOR brendan . d . burns @ gmail . com , 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"PO-Revision-Date: 2016-12-13 21:54-0800\n"
"Last-Translator: Brendan Burns <brendan.d.burns@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
msgctxt "Update the annotations on a resource"
msgid "Update the annotations on a resource"
msgstr "Update the annotations on a resource"
msgctxt ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid_plural ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgstr [ 0 ] ""
"watch is only supported on individual resources and resource collections - "
"%d resource was found"
msgstr [ 1 ] ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
2016-12-25 13:09:03 +08:00
# https : //github.com/kubernetes/kubernetes/blob/masterpkg/kubectl/cmd/apply.go#L98
msgctxt "Apply a configuration to a resource by filename or stdin"
msgid "Apply a configuration to a resource by filename or stdin"
msgstr "Apply a configuration to a resource by filename or stdin"
2017-01-10 22:32:43 +08:00
` )
2016-12-14 15:18:11 +08:00
func translationsKubectlDefaultLc_messagesK8sPoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsKubectlDefaultLc_messagesK8sPo , nil
2016-12-14 15:18:11 +08:00
}
func translationsKubectlDefaultLc_messagesK8sPo ( ) ( * asset , error ) {
bytes , err := translationsKubectlDefaultLc_messagesK8sPoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/kubectl/default/LC_MESSAGES/k8s.po" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsKubectlEn_usLc_messagesK8sMo = [ ] byte ( "\xde\x12\x04\x95\x00\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x004\x00\x00\x00\x05\x00\x00\x00L\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00I\x00\x00\x00a\x00\x00\x00(\x01\x00\x00\xab\x00\x00\x00\xac\x01\x00\x00\xd4\x01\x00\x00$\x00\x00\x00\x81\x03\x00\x00\xc3\x00\x00\x00\xa6\x03\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00Update the annotations on a resource\x04Update the annotations on a resource\x00watch is only supported on individual resources and resource collections - %d resources were found\x04watch is only supported on individual resources and resource collections - %d resources were found\x00watch is only supported on individual resources and resource collections - %d resources were found\x00Project-Id-Version: gettext-go-examples-hello\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2013-12-12 20:03+0000\nPO-Revision-Date: 2016-12-13 22:35-0800\nLast-Translator: Brendan Burns <brendan.d.burns@gmail.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: Poedit 1.6.10\nX-Poedit-SourceCharset: UTF-8\nLanguage-Team: \nPlural-Forms: nplurals=2; plural=(n != 1);\nLanguage: en\n\x00Update the annotations on a resource\x00watch is only supported on individual resources and resource collections - %d resource was found\x00watch is only supported on individual resources and resource collections - %d resources were found\x00" )
2016-12-14 15:18:11 +08:00
func translationsKubectlEn_usLc_messagesK8sMoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsKubectlEn_usLc_messagesK8sMo , nil
2016-12-14 15:18:11 +08:00
}
func translationsKubectlEn_usLc_messagesK8sMo ( ) ( * asset , error ) {
bytes , err := translationsKubectlEn_usLc_messagesK8sMoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/kubectl/en_US/LC_MESSAGES/k8s.mo" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsKubectlEn_usLc_messagesK8sPo = [ ] byte ( ` # Test translations for unit tests .
# Copyright ( C ) 2016
# This file is distributed under the same license as the PACKAGE package .
# FIRST AUTHOR brendan . d . burns @ gmail . com , 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"PO-Revision-Date: 2016-12-13 22:35-0800\n"
"Last-Translator: Brendan Burns <brendan.d.burns@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
msgctxt "Update the annotations on a resource"
msgid "Update the annotations on a resource"
msgstr "Update the annotations on a resource"
msgctxt ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgid_plural ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
msgstr [ 0 ] ""
"watch is only supported on individual resources and resource collections - "
"%d resource was found"
msgstr [ 1 ] ""
"watch is only supported on individual resources and resource collections - "
"%d resources were found"
2016-12-25 13:09:03 +08:00
# https : //github.com/kubernetes/kubernetes/blob/masterpkg/kubectl/cmd/apply.go#L98
msgctxt "Apply a configuration to a resource by filename or stdin"
msgid "Apply a configuration to a resource by filename or stdin"
msgstr "Apply a configuration to a resource by filename or stdin"
2017-01-10 22:32:43 +08:00
` )
2016-12-14 15:18:11 +08:00
func translationsKubectlEn_usLc_messagesK8sPoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsKubectlEn_usLc_messagesK8sPo , nil
2016-12-14 15:18:11 +08:00
}
func translationsKubectlEn_usLc_messagesK8sPo ( ) ( * asset , error ) {
bytes , err := translationsKubectlEn_usLc_messagesK8sPoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/kubectl/en_US/LC_MESSAGES/k8s.po" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsTestDefaultLc_messagesK8sMo = [ ] byte ( "\xde\x12\x04\x95\x00\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x004\x00\x00\x00\x05\x00\x00\x00L\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00#\x00\x00\x00a\x00\x00\x00\x17\x00\x00\x00\x85\x00\x00\x00\xac\x01\x00\x00\x9d\x00\x00\x00%\x00\x00\x00J\x02\x00\x00\x03\x00\x00\x00p\x02\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00test_plural\x04test_plural\x00test_plural\x00test_string\x04test_string\x00Project-Id-Version: gettext-go-examples-hello\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2013-12-12 20:03+0000\nPO-Revision-Date: 2016-12-13 21:35-0800\nLast-Translator: Brendan Burns <brendan.d.burns@gmail.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: Poedit 1.6.10\nX-Poedit-SourceCharset: UTF-8\nLanguage-Team: \nPlural-Forms: nplurals=2; plural=(n != 1);\nLanguage: en\n\x00there was %d item\x00there were %d items\x00foo\x00" )
2016-12-14 15:18:11 +08:00
func translationsTestDefaultLc_messagesK8sMoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsTestDefaultLc_messagesK8sMo , nil
2016-12-14 15:18:11 +08:00
}
func translationsTestDefaultLc_messagesK8sMo ( ) ( * asset , error ) {
bytes , err := translationsTestDefaultLc_messagesK8sMoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/test/default/LC_MESSAGES/k8s.mo" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsTestDefaultLc_messagesK8sPo = [ ] byte ( ` # Test translations for unit tests .
# Copyright ( C ) 2016
# This file is distributed under the same license as the PACKAGE package .
# FIRST AUTHOR brendan . d . burns @ gmail . com , 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"PO-Revision-Date: 2016-12-13 21:35-0800\n"
"Last-Translator: Brendan Burns <brendan.d.burns@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
msgctxt "test_string"
msgid "test_string"
msgstr "foo"
msgctxt "test_plural"
msgid "test_plural"
msgid_plural "test_plural"
msgstr [ 0 ] "there was %d item"
msgstr [ 1 ] "there were %d items"
` )
2016-12-14 15:18:11 +08:00
func translationsTestDefaultLc_messagesK8sPoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsTestDefaultLc_messagesK8sPo , nil
2016-12-14 15:18:11 +08:00
}
func translationsTestDefaultLc_messagesK8sPo ( ) ( * asset , error ) {
bytes , err := translationsTestDefaultLc_messagesK8sPoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/test/default/LC_MESSAGES/k8s.po" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsTestEn_usLc_messagesK8sMo = [ ] byte ( "\xde\x12\x04\x95\x00\x00\x00\x00\x03\x00\x00\x00\x1c\x00\x00\x004\x00\x00\x00\x05\x00\x00\x00L\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00#\x00\x00\x00a\x00\x00\x00\x17\x00\x00\x00\x85\x00\x00\x00\xac\x01\x00\x00\x9d\x00\x00\x00%\x00\x00\x00J\x02\x00\x00\x03\x00\x00\x00p\x02\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00test_plural\x04test_plural\x00test_plural\x00test_string\x04test_string\x00Project-Id-Version: gettext-go-examples-hello\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2013-12-12 20:03+0000\nPO-Revision-Date: 2016-12-13 22:12-0800\nLast-Translator: Brendan Burns <brendan.d.burns@gmail.com>\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: Poedit 1.6.10\nX-Poedit-SourceCharset: UTF-8\nLanguage-Team: \nPlural-Forms: nplurals=2; plural=(n != 1);\nLanguage: en\n\x00there was %d item\x00there were %d items\x00baz\x00" )
2016-12-14 15:18:11 +08:00
func translationsTestEn_usLc_messagesK8sMoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsTestEn_usLc_messagesK8sMo , nil
2016-12-14 15:18:11 +08:00
}
func translationsTestEn_usLc_messagesK8sMo ( ) ( * asset , error ) {
bytes , err := translationsTestEn_usLc_messagesK8sMoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/test/en_US/LC_MESSAGES/k8s.mo" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 0 ) }
a := & asset { bytes : bytes , info : info }
return a , nil
}
2017-01-10 22:32:43 +08:00
var _translationsTestEn_usLc_messagesK8sPo = [ ] byte ( ` # Test translations for unit tests .
# Copyright ( C ) 2016
# This file is distributed under the same license as the PACKAGE package .
# FIRST AUTHOR brendan . d . burns @ gmail . com , 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: gettext-go-examples-hello\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 20:03+0000\n"
"PO-Revision-Date: 2016-12-13 22:12-0800\n"
"Last-Translator: Brendan Burns <brendan.d.burns@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
msgctxt "test_string"
msgid "test_string"
msgstr "baz"
msgctxt "test_plural"
msgid "test_plural"
msgid_plural "test_plural"
msgstr [ 0 ] "there was %d item"
msgstr [ 1 ] "there were %d items"
` )
2016-12-14 15:18:11 +08:00
func translationsTestEn_usLc_messagesK8sPoBytes ( ) ( [ ] byte , error ) {
2017-01-10 22:32:43 +08:00
return _translationsTestEn_usLc_messagesK8sPo , nil
2016-12-14 15:18:11 +08:00
}
func translationsTestEn_usLc_messagesK8sPo ( ) ( * asset , error ) {
bytes , err := translationsTestEn_usLc_messagesK8sPoBytes ( )
if err != nil {
return nil , err
}
info := bindataFileInfo { name : "translations/test/en_US/LC_MESSAGES/k8s.po" , size : 0 , mode : os . FileMode ( 0 ) , modTime : time . Unix ( 0 , 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 ) {
2016-12-25 13:09:03 +08:00
"translations/extract.py" : translationsExtractPy ,
2016-12-14 15:18:11 +08:00
"translations/kubectl/default/LC_MESSAGES/k8s.mo" : translationsKubectlDefaultLc_messagesK8sMo ,
"translations/kubectl/default/LC_MESSAGES/k8s.po" : translationsKubectlDefaultLc_messagesK8sPo ,
"translations/kubectl/en_US/LC_MESSAGES/k8s.mo" : translationsKubectlEn_usLc_messagesK8sMo ,
"translations/kubectl/en_US/LC_MESSAGES/k8s.po" : translationsKubectlEn_usLc_messagesK8sPo ,
"translations/test/default/LC_MESSAGES/k8s.mo" : translationsTestDefaultLc_messagesK8sMo ,
"translations/test/default/LC_MESSAGES/k8s.po" : translationsTestDefaultLc_messagesK8sPo ,
"translations/test/en_US/LC_MESSAGES/k8s.mo" : translationsTestEn_usLc_messagesK8sMo ,
"translations/test/en_US/LC_MESSAGES/k8s.po" : translationsTestEn_usLc_messagesK8sPo ,
}
// 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 {
"translations" : { nil , map [ string ] * bintree {
2016-12-25 13:09:03 +08:00
"extract.py" : { translationsExtractPy , map [ string ] * bintree { } } ,
2016-12-14 15:18:11 +08:00
"kubectl" : { nil , map [ string ] * bintree {
"default" : { nil , map [ string ] * bintree {
"LC_MESSAGES" : { nil , map [ string ] * bintree {
"k8s.mo" : { translationsKubectlDefaultLc_messagesK8sMo , map [ string ] * bintree { } } ,
"k8s.po" : { translationsKubectlDefaultLc_messagesK8sPo , map [ string ] * bintree { } } ,
} } ,
} } ,
"en_US" : { nil , map [ string ] * bintree {
"LC_MESSAGES" : { nil , map [ string ] * bintree {
"k8s.mo" : { translationsKubectlEn_usLc_messagesK8sMo , map [ string ] * bintree { } } ,
"k8s.po" : { translationsKubectlEn_usLc_messagesK8sPo , map [ string ] * bintree { } } ,
} } ,
} } ,
} } ,
"test" : { nil , map [ string ] * bintree {
"default" : { nil , map [ string ] * bintree {
"LC_MESSAGES" : { nil , map [ string ] * bintree {
"k8s.mo" : { translationsTestDefaultLc_messagesK8sMo , map [ string ] * bintree { } } ,
"k8s.po" : { translationsTestDefaultLc_messagesK8sPo , map [ string ] * bintree { } } ,
} } ,
} } ,
"en_US" : { nil , map [ string ] * bintree {
"LC_MESSAGES" : { nil , map [ string ] * bintree {
"k8s.mo" : { translationsTestEn_usLc_messagesK8sMo , map [ string ] * bintree { } } ,
"k8s.po" : { translationsTestEn_usLc_messagesK8sPo , 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 , "/" ) ... ) ... )
}