Package s3 :: Module s3translate :: Class Strings
[frames] | no frames]

Class Strings

source code

object --+
         |
        Strings

Class to manipulate strings and their files

Instance Methods
 
export_file(self, langfile, modlist, filelist, filetype, all_template_flag)
Function to get the strings by module(s)/file(s), merge with those strings from existing w2p language file which are already translated and call the "write_xls()" method if the default filetype "xls" is chosen.
source code
 
write_po(self, data)
Returns a ".po" file constructed from given strings
source code
 
write_w2p(self, csvfiles, lang_code, option)
Function to merge multiple translated csv files into one and then merge/overwrite the existing w2p language file
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
 
remove_quotes(Strings)
Function to remove single or double quotes around the strings
source code
 
remove_duplicates(Strings)
Function to club all the duplicate strings into one row with ";" separated locations
source code
 
remove_untranslated(lang_code)
Function to remove all untranslated strings from a lang_code.py
source code
 
read_csv(fileName)
Function to read a CSV file and return a list of rows
source code
 
read_w2p(fileName)
Function to read a web2py language file and return a list of translation string pairs
source code
 
write_csv(fileName, data)
Function to write a list of rows into a csv file
source code
 
write_xls(Strings, langcode)
Function to create a spreadsheet (.xls file) of strings with location, original string and translated string as columns
source code
Properties

Inherited from object: __class__

Method Details

remove_quotes(Strings)
Static Method

source code 

Function to remove single or double quotes around the strings

remove_duplicates(Strings)
Static Method

source code 

Function to club all the duplicate strings into one row with ";" separated locations

remove_untranslated(lang_code)
Static Method

source code 

Function to remove all untranslated strings from a lang_code.py

export_file(self, langfile, modlist, filelist, filetype, all_template_flag)

source code 

Function to get the strings by module(s)/file(s), merge with those strings from existing w2p language file which are already translated and call the "write_xls()" method if the default filetype "xls" is chosen. If "po" is chosen, then the write_po()" method is called.

read_csv(fileName)
Static Method

source code 

Function to read a CSV file and return a list of rows

read_w2p(fileName)
Static Method

source code 

Function to read a web2py language file and return a list of translation string pairs

write_csv(fileName, data)
Static Method

source code 

Function to write a list of rows into a csv file

write_po(self, data)

source code 

Returns a ".po" file constructed from given strings

write_w2p(self, csvfiles, lang_code, option)

source code 

Function to merge multiple translated csv files into one and then merge/overwrite the existing w2p language file

write_xls(Strings, langcode)
Static Method

source code 

Function to create a spreadsheet (.xls file) of strings with location, original string and translated string as columns