154
156
@plugins[type].keys
158
#Returns true if the plugin is translatable (in the metadata file "translatable" : true),
160
def translatable? name, type
161
etc(name, type)['translatable'] || false
163
#Returns the translation text domain of the plugin.
164
#(specified by the "textdomain" key in the metadata file)
165
def textdomain name, type
166
etc(name, type)['textdomain'] || false
168
#Translates a string for a particular plugin.
169
def translate name, type, str
171
translator_class = Class.new do
173
bindtextdomain textdomain(name, type)
178
translator_class.new.translate(str)
157
183
#A more descriptive name (eg. file-compressor => Compress File)
158
184
#Imagine: what would be written on a button that excecutes the plugin.
159
185
def long_name name, type
160
etc(name, type)['long_name'] || ''
186
translate( name, type,
187
etc(name, type)['long_name'] || ''
162
190
#A short description of what the plugin does.
163
191
#(eg. file-compressor => Compresses the file so that it takes up less disk space)
164
192
#Imagine: a tooltip for a button that excecutes the plugin.
165
193
def summary name, type
166
etc(name, type)['summary'] || ''
194
translate( name, type,
195
etc(name, type)['summary'] || ''
168
198
#A more detailed description.
169
199
#(eg. file-compressor => Compresses the file using gzip so that it takes up less
170
200
#disk space. Options are available to use bzip2 or lzma instead for a higher
171
201
#compression ratio.)
172
202
def description name, type
173
etc(name, type)['description'] || ''
203
translate( name, type,
204
etc(name, type)['description'] || ''
175
207
#A list of the people who created the plugin.
176
208
def authors name, type
184
216
def homepage name, type
185
217
etc(name, type)['homepage'] || ''
188
#Hopefully, in the future, plugins can have translatable
189
#long_name/summary/description etc. (how???).
190
#This will return a true or false value that describes whether
191
#or not the plugin can be translated. Currently returns false regardless.
192
def translatable? name, type