Method: Debian::AptPkg::Configuration.languages
- Defined in:
- ext/apt_pkg/configuration.cpp
permalink .languages ⇒ Array
Return the list of languages code.
Params:
all
-
All languages code or short for false.
Debian::AptPkg::Configuration.languages # => ["en", "none", "fr"]
Debian::AptPkg::Configuration.languages(false) # => ["en"]
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'ext/apt_pkg/configuration.cpp', line 51
static VALUE
languages(int argc, VALUE *argv, VALUE self)
{
VALUE all;
rb_scan_args(argc, argv, "01", &all);
VALUE result = rb_ary_new();
std::vector < std::string > const langs =
APT::Configuration::getLanguages(all);
std::vector < std::string >::const_iterator I;
for (I = langs.begin(); I != langs.end(); ++I) {
rb_ary_push(result, rb_str_new2((*I).c_str()));
}
return result;
}
|