You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
gnome-shell-extension-openw.../po/update.js

54 lines
1.9 KiB

#!/usr/bin/env seed
/*
*
* PO Updater for GNOME Shell Extension Weather
*
* Copyright (C) 2012 -2014
* Christian METZLER <neroth@xeked.com>
* Jens Lody <jens@jenslody.de>,
*
*
* This file is part of gnome-shell-extension-openweather.
*
* gnome-shell-extension-openweather is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* gnome-shell-extension-openweather is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with gnome-shell-extension-openweather. If not, see <http://www.gnu.org/licenses/>.
*
*/
Gio = imports.gi.Gio;
print("Generate gnome-shell-extension-openweather.pot");
var xgettext = Seed.spawn("xgettext -o gnome-shell-extension-openweather.pot -L python --from-code=utf-8 --keyword=_ -f POTFILES.in");
if (xgettext.stderr)
print(xgettext.stderr);
else {
var file = Gio.file_new_for_path(".");
var enumerator = file.enumerate_children("standard::name,standard::size");
var linguas = "";
var n = "";
var i = 0;
while (child = enumerator.next_file())
if (child.get_name().search(/.po$/) != -1) {
print("Generate " + child.get_name());
linguas += n + (child.get_name().split(".po")[0]);
Seed.spawn("msgmerge -U " + child.get_name() + " gnome-shell-extension-openweather.pot");
n = "\n";
i++;
}
print("Write LINGUAS file");
Gio.simple_write("LINGUAS", linguas);
print("Successfully generated " + i + " entry");
}