summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-08 01:38:28 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-07-08 01:38:28 -0400
commitab53fc947459a55bc3a08b32378f68519f42b31e (patch)
treee332dfe678d0f4ff3cae5c1d08849e2a7b5f95da
parenta626f32d8e01faa620a11e1f8370a35cc660a579 (diff)
parentbe8d77c923370ed72da85fac39908a57556557b4 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
-rw-r--r--js/util.js1
-rwxr-xr-xscripts/update_translations.php28
2 files changed, 23 insertions, 6 deletions
diff --git a/js/util.js b/js/util.js
index 9bb7c9128..7a7a5e30b 100644
--- a/js/util.js
+++ b/js/util.js
@@ -223,6 +223,7 @@ $(document).ready(function(){
}
$("#notice_data-text").val("");
$("#notice_data-attach").val("");
+ $("#notice_in-reply-to").val("");
$('#notice_data-attach_selected').remove();
counter();
}
diff --git a/scripts/update_translations.php b/scripts/update_translations.php
index c0919161a..2f4ca8720 100755
--- a/scripts/update_translations.php
+++ b/scripts/update_translations.php
@@ -42,7 +42,7 @@ $languages = get_all_languages();
foreach ($languages as $language) {
$code = $language['lang'];
- $file = 'http://laconi.ca/pootle/' . $code .
+ $file_url = 'http://laconi.ca/pootle/' . $code .
'/laconica/LC_MESSAGES/laconica.po';
$lcdir = INSTALLDIR . '/locale/' . $code;
$msgdir = "$lcdir/LC_MESSAGES";
@@ -59,18 +59,18 @@ foreach ($languages as $language) {
}
/* Get the remote one */
- $newFile = file_get_contents($file);
+ $new_file = curl_get_file($file_url);
- if ($newfile === FALSE) {
- echo "Couldn't retrieve .po file for $code: $file\n";
+ if ($new_file === FALSE) {
+ echo "Couldn't retrieve .po file for $code: $file_url\n";
continue;
}
// Update if the local .po file is different to the one downloaded, or
// if the .mo file is not present.
- if (sha1($newFile) != $existingSHA1 || !file_exists($mofile)) {
+ if (sha1($new_file) != $existingSHA1 || !file_exists($mofile)) {
echo "Updating ".$code."\n";
- file_put_contents($pofile, $newFile);
+ file_put_contents($pofile, $new_file);
system(sprintf('msgmerge -U %s %s', $pofile, $laconica_pot));
system(sprintf('msgfmt -f -o %s %s', $mofile, $pofile));
} else {
@@ -79,3 +79,19 @@ foreach ($languages as $language) {
}
echo "Finished\n";
+
+
+function curl_get_file($url)
+{
+ $c = curl_init();
+ curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($c, CURLOPT_URL, $url);
+ $contents = curl_exec($c);
+ curl_close($c);
+
+ if (!empty($contents)) {
+ return $contents;
+ }
+
+ return FALSE;
+}