Browse Source

Merge branch 'master' of git://github.com/friendika/friendika

pull/1/head
Tobias Diekershoff 11 years ago
parent
commit
878bdeccfd
  1. 2
      addon/facebook/facebook.php
  2. 53
      boot.php
  3. BIN
      images/pencil.gif
  4. BIN
      images/recycle.gif
  5. BIN
      images/remote-link.gif
  6. 5
      include/Contact.php
  7. 46
      include/pgettext.php
  8. 8
      mod/contacts.php
  9. 4
      mod/dfrn_confirm.php
  10. 7
      mod/dfrn_notify.php
  11. 4
      mod/dfrn_poll.php
  12. 18
      mod/dfrn_request.php
  13. 4
      mod/display.php
  14. 91
      mod/editpost.php
  15. 2
      mod/home.php
  16. 10
      mod/invite.php
  17. 130
      mod/item.php
  18. 12
      mod/like.php
  19. 2
      mod/lostpass.php
  20. 2
      mod/manage.php
  21. 4
      mod/network.php
  22. 2
      mod/openid.php
  23. 1
      mod/photos.php
  24. 7
      mod/profile.php
  25. 10
      mod/profile_photo.php
  26. 4
      mod/register.php
  27. 4
      mod/regmod.php
  28. 3
      mod/viewcontacts.php
  29. 2
      mod/wall_upload.php
  30. 72
      util/README
  31. 47
      util/extract.php
  32. 2411
      util/messages.po
  33. 71
      util/php2po.php
  34. 103
      util/po2php.php
  35. 36
      util/run_xgettext.sh
  36. 139
      util/strings.php
  37. 2507
      view/it/messages.po
  38. 1665
      view/it/strings.php
  39. 2
      view/like.tpl
  40. 2
      view/sv/contact_edit.tpl
  41. 57
      view/sv/cropbody.tpl
  42. 17
      view/sv/dfrn_req_confirm.tpl
  43. 14
      view/sv/directory_header.tpl
  44. 14
      view/sv/follow_notify_eml.tpl
  45. 22
      view/sv/friend_complete_eml.tpl
  46. 24
      view/sv/group_edit.tpl
  47. 23
      view/sv/group_new.tpl
  48. 32
      view/sv/head.tpl
  49. 74
      view/sv/htconfig.tpl
  50. 6
      view/sv/insecure_net.tpl
  51. 40
      view/sv/install_db.tpl
  52. 22
      view/sv/intro_complete_eml.tpl
  53. 7
      view/sv/intros-top.tpl
  54. 172
      view/sv/jot-header.tpl
  55. 18
      view/sv/lostpass.tpl
  56. 32
      view/sv/lostpass_eml.tpl
  57. 25
      view/sv/mail_received_html_body_eml.tpl
  58. 10
      view/sv/mail_received_text_body_eml.tpl
  59. 104
      view/sv/msg-header.tpl
  60. 25
      view/sv/pagetypes.tpl
  61. 20
      view/sv/passchanged_eml.tpl
  62. 16
      view/sv/profile-hide-friends.tpl
  63. 16
      view/sv/profile-in-directory.tpl
  64. 16
      view/sv/profile-in-netdir.tpl
  65. 72
      view/sv/profile.php
  66. 225
      view/sv/profile_advanced.php
  67. 299
      view/sv/profile_edit.tpl
  68. 9
      view/sv/profile_entry_default.tpl
  69. 8
      view/sv/profile_listing_header.tpl
  70. 18
      view/sv/profile_photo.tpl
  71. 7
      view/sv/profile_tabs.tpl
  72. 16
      view/sv/pwdreset.tpl
  73. 21
      view/sv/register_open_eml.tpl
  74. 26
      view/sv/register_verify_eml.tpl
  75. 3
      view/sv/registrations-top.tpl
  76. 1
      view/sv/registrations.tpl
  77. 17
      view/sv/request_notify_eml.tpl
  78. 168
      view/sv/settings.tpl
  79. 9
      view/sv/settings_nick_set.tpl
  80. 6
      view/sv/settings_nick_subdir.tpl
  81. 14
      view/sv/settings_nick_unset.tpl
  82. 98
      view/sv/strings.php
  83. 18
      view/sv/wall_received_eml.tpl
  84. 4
      view/theme/duepuntozero/style.css
  85. 4
      view/theme/loozah/style.css
  86. 1
      view/wall_item.tpl
  87. 1
      view/wallwall_item.tpl

2
addon/facebook/facebook.php

@ -237,7 +237,7 @@ function facebook_post_hook(&$a,&$b) {
require_once('library/slinky.php');
$display_url = $a->get_baseurl() . '/display/' . $a->user['nickname'] . '/' . $b['id'];
$slinky = new Slinky( $posturl );
$slinky = new Slinky( $display_url );
// setup a cascade of shortening services
// try to get a short link from these services
// in the order ur1.ca, trim, id.gd, tinyurl

53
boot.php

@ -2,7 +2,7 @@
set_time_limit(0);
define ( 'FRIENDIKA_VERSION', '2.1.920' );
define ( 'FRIENDIKA_VERSION', '2.1.921' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'DB_UPDATE_VERSION', 1043 );
@ -159,6 +159,11 @@ if (get_magic_quotes_gpc()) {
unset($process);
}
/*
* translation system
*/
require_once("include/pgettext.php");
/**
*
@ -601,28 +606,6 @@ function replace_macros($s,$r) {
}}
// load string translation table for alternate language
if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
if(file_exists("view/$lang/strings.php"))
include("view/$lang/strings.php");
}}
// translate string if translation exists
if(! function_exists('t')) {
function t($s) {
$a = get_app();
if(x($a->strings,$s))
return $a->strings[$s];
return $s;
}}
// curl wrapper. If binary flag is true, return binary
// results.
@ -1845,10 +1828,14 @@ if(! function_exists('format_like')) {
function format_like($cnt,$arr,$type,$id) {
$o = '';
if($cnt == 1)
$o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
$o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ;
else {
$o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >'
. $cnt . ' ' . t('people') . '</span> ' . (($type === 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"';
$o .= (($type === 'like') ?
sprintf( t('<span %1$s>%2$d people</span> like this.'), $spanatts, $cnt)
:
sprintf( t('<span %1$s>%2$d people</span> don\'t like this.'), $spanatts, $cnt) );
$o .= EOL ;
$total = count($arr);
if($total >= MAX_LIKERS)
$arr = array_slice($arr, 0, MAX_LIKERS - 1);
@ -1856,8 +1843,8 @@ function format_like($cnt,$arr,$type,$id) {
$arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
$str = implode(', ', $arr);
if($total >= MAX_LIKERS)
$str .= t(', and ') . $total - MAX_LIKERS . t(' other people');
$str .= (($type === 'like') ? t(' like this.') : t(' don\'t like this.'));
$str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
$str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str));
$o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
}
return $o;
@ -2423,7 +2410,13 @@ function get_birthdays() {
);
if($r && count($r)) {
$o .= '<div id="birthday-wrapper"><div id="birthday-title">' . t('Birthdays this week:') . '</div>';
$total = 0;
foreach($r as $rr)
if(strlen($rr['name']))
$total ++;
$o .= '<div id="birthday-notice" class="birthday-notice fakelink" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>';
$o .= '<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">' . t('Birthdays this week:') . '</div>';
$o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
$o .= '<div id="birthday-title-end"></div>';
@ -2439,7 +2432,7 @@ function get_birthdays() {
. '</div>' ;
}
$o .= '</div>';
$o .= '</div></div>';
}
return $o;

BIN
images/pencil.gif

After

Width: 16  |  Height: 16  |  Size: 553 B

BIN
images/recycle.gif

After

Width: 16  |  Height: 16  |  Size: 612 B

BIN
images/remote-link.gif

Before

Width: 16  |  Height: 16  |  Size: 365 B

After

Width: 16  |  Height: 16  |  Size: 237 B

5
include/Contact.php

@ -14,11 +14,13 @@ function user_remove($uid) {
q("DELETE FROM `group` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `group_member` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `intro` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `event` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `item` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `mail` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `photo` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `user` WHERE `uid` = %d", intval($uid));
if($uid == local_user()) {
unset($_SESSION['authenticated']);
@ -41,6 +43,9 @@ function contact_remove($id) {
q("DELETE FROM `mail` WHERE `contact-id` = %d ",
intval($id)
);
q("DELETE FROM `event` WHERE `cid` = %d ",
intval($id)
);
}

46
include/pgettext.php

@ -0,0 +1,46 @@
<?php
/**
* translation support
*/
// load string translation table for alternate language
if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
if(file_exists("view/$lang/strings.php"))
include("view/$lang/strings.php");
}}
// translate string if translation exists
if(! function_exists('t')) {
function t($s) {
$a = get_app();
if(x($a->strings,$s)) {
$t = $a->strings[$s];
return is_array($t)?$t[0]:$t;
}
return $s;
}}
if(! function_exists('tt')){
function tt($singular, $plural, $count){
$a = get_app();
if(x($a->strings,$singular)) {
$t = $a->strings[$singular];
$k = string_plural_select($count);
return is_array($t)?$t[$k]:$t;
}
if ($count!=1){
return $plural;
} else {
return $singular;
}
}}

8
mod/contacts.php

@ -137,7 +137,8 @@ function contacts_content(&$a) {
intval(local_user())
);
if($r) {
notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
//notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
notice( (($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
return; // NOTREACHED
@ -151,7 +152,7 @@ function contacts_content(&$a) {
intval(local_user())
);
if($r) {
notice( t('Contact has been ') . (($readonly) ? t('ignored') : t('unignored')) . EOL );
notice( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
return; // NOTREACHED
@ -364,13 +365,14 @@ function contacts_content(&$a) {
$o .= replace_macros($tpl, array(
'$img_hover' => t('Visit ') . $rr['name'] . t('\'s profile'),
'$img_hover' => t('Visit $username\'s profile'),
'$edit_hover' => t('Edit contact'),
'$id' => $rr['id'],
'$alt_text' => $alt_text,
'$dir_icon' => $dir_icon,
'$thumb' => $rr['thumb'],
'$name' => substr($rr['name'],0,20),
'$username' => $rr['name'],
'$sparkle' => $sparkle,
'$url' => $url
));

4
mod/dfrn_confirm.php

@ -491,7 +491,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
dbesc($node));
if(! count($r)) {
$message = t('No user record found for ') . '\'' . $node . '\'';
$message = sprintf(t('No user record found for \'%s\' '), $node);
xml_status(3,$message); // failure
// NOTREACHED
}
@ -645,7 +645,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
'$uid' => $newuid )
);
$res = mail($r[0]['email'], t("Connection accepted at ") . $a->config['sitename'],
$res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']),
$email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] );
if(!$res) {
// pointless throwing an error here and confusing the person at the other end of the wire.

7
mod/dfrn_notify.php

@ -385,7 +385,7 @@ function dfrn_notify_post(&$a) {
'$body' => html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8')
));
$res = mail($importer['email'], $from . t(' commented on an item at ') . $a->config['sitename'],
$res = mail($importer['email'], sprintf(t('%s commented on an item at %s'), $from , $a->config['sitename']),
$email_tpl, "From: " . t('Administrator') . '@' . $a->get_hostname() );
}
}
@ -471,9 +471,8 @@ function dfrn_notify_post(&$a) {
'$body' => html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8')
));
$res = mail($importer['email'], $from . t(" commented on an item at ")
. $a->config['sitename'],
$email_tpl,t("From: Administrator@") . $a->get_hostname() );
$res = mail($importer['email'], sprintf( t("%s commented on an item at %s") , $from ,$a->config['sitename']),
$email_tpl, "From: ".t("Administrator") . "@". $a->get_hostname() );
break;
}
}

4
mod/dfrn_poll.php

@ -75,7 +75,7 @@ function dfrn_poll_init(&$a) {
$_SESSION['authenticated'] = 1;
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
notice( $r[0]['username'] . t(' welcomes ') . $r[0]['name'] . EOL);
notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
// Visitors get 1 day session.
$session_id = session_id();
$expire = time() + 86400;
@ -389,7 +389,7 @@ function dfrn_poll_content(&$a) {
$_SESSION['authenticated'] = 1;
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
notice( $r[0]['username'] . t(' welcomes ') . $r[0]['name'] . EOL);
notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
// Visitors get 1 day session.
$session_id = session_id();
$expire = time() + 86400;

18
mod/dfrn_request.php

@ -123,9 +123,9 @@ function dfrn_request_post(&$a) {
notice( t('Warning: profile location has no profile photo.') . EOL );
$invalid = validate_dfrn($parms);
if($invalid) {
notice( $invalid . t(' required parameter')
. (($invalid == 1) ? t(" was ") : t("s were ") )
. t("not found at the given location.") . EOL ) ;
notice( sprintf( tt("%d required parameter was not found at the given location",
"%d required parameters were not found at the given location",
$invalid), $invalid) . EOL );
return;
}
}
@ -238,7 +238,7 @@ function dfrn_request_post(&$a) {
intval($uid)
);
if(count($r) > $maxreq) {
notice( $a->profile['name'] . t(' has received too many connection requests today.') . EOL);
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
notice( t('Spam protection measures have been invoked.') . EOL);
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
return;
@ -306,7 +306,7 @@ function dfrn_request_post(&$a) {
return;
}
elseif($ret[0]['rel'] == REL_BUD) {
notice( t('Apparently you are already friends with .') . $a->profile['name'] . EOL);
notice( sprintf( t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
return;
}
else {
@ -354,9 +354,9 @@ function dfrn_request_post(&$a) {
notice( t('Warning: profile location has no profile photo.') . EOL );
$invalid = validate_dfrn($parms);
if($invalid) {
notice( $invalid . t(' required parameter')
. (($invalid == 1) ? t(" was ") : t("s were ") )
. t("not found at the given location.") . EOL ) ;
notice( sprintf( tt("%d required parameter was not found at the given location",
"%d required parameters were not found at the given location",
$invalid), $invalid) . EOL );
return;
}
@ -540,7 +540,7 @@ function dfrn_request_content(&$a) {
'$sitename' => $a->config['sitename']
));
$res = mail($r[0]['email'],
t("Introduction received at ") . $a->config['sitename'],
t("Introduction received at ") . $a->config['sitename'],
$email,
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] );
// This is a redundant notification - no point throwing errors if it fails.

4
mod/display.php

@ -217,6 +217,9 @@ function display_content(&$a) {
$profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']);
$edpost = '';
if((local_user()) && ($item['uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
$edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
// Can we use our special contact URL for this author?
if(strlen($item['author-link'])) {
@ -276,6 +279,7 @@ function display_content(&$a) {
'$owner_photo' => $owner_photo,
'$owner_name' => $owner_name,
'$plink' => get_plink($item),
'$edpost' => $edpost,
'$drop' => $drop,
'$vote' => $likebuttons,
'$like' => $like,

91
mod/editpost.php

@ -0,0 +1,91 @@
<?php
require_once('acl_selectors.php');
function editpost_content(&$a) {
$o = '';
if(! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if(! $post_id) {
notice( t('Item not found') . EOL);
return;
}
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($post_id),
intval(local_user())
);
if(! count($r)) {
notice( t('Item not found') . EOL);
return;
}
$o .= '<h2>' . t('Edit post') . '</h2>';
$tpl = load_view_file('view/jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$geotag' => $geotag,
'$nickname' => $a->user['nickname']
));
$tpl = load_view_file("view/jot.tpl");
if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))))
$lockstate = 'lock';
else
$lockstate = 'unlock';
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$jotplugins = '';
$jotnets = '';
call_hooks('jot_tool', $jotplugins);
call_hooks('jot_networks', $jotnets);
$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
$o .= replace_macros($tpl,array(
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
'$share' => t('Edit'),
'$upload' => t('Upload photo'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
'$video' => t('Insert Vorbis [.ogg] video'),
'$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'),
'$noloc' => t('Clear browser location'),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$content' => $r[0]['body'],
'$post_id' => $post_id,
'$baseurl' => $a->get_baseurl(),
'$defloc' => $a->user['default-location'],
'$visitor' => 'none',
'$emailcc' => t('CC: email addresses'),
'$jotnets' => $jotnets,
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
'$bang' => (($group) ? '!' : ''),
'$profile_uid' => $_SESSION['uid']
));
return $o;
}

2
mod/home.php

@ -20,7 +20,7 @@ function home_content(&$a) {
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
$o .= '<h1>' . ((x($a->config,'sitename')) ? t("Welcome to ").$a->config['sitename'] : "" ) . '</h1>';
$o .= '<h1>' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';
if(file_exists('home.html'))
$o .= file_get_contents('home.html');

10
mod/invite.php

@ -25,21 +25,21 @@ function invite_post(&$a) {
$recip = trim($recip);
if(! valid_email($recip)) {
notice( $recip . t(' : ') . t('Not a valid email address.') . EOL);
notice( sprintf( t('%s : Not a valid email address.'), $recip) . EOL);
continue;
}
$res = mail($recip, t('Please join my network on ') . $a->config['sitename'],
$res = mail($recip, sprintf(t('Please join my network on %s'), $a->config['sitename']),
$message, "From: " . $a->user['email']);
if($res) {
$total ++;
}
else {
notice( $recip . t(' : ') . t('Message delivery failed.') . EOL);
notice( sprintf( t('%s : Message delivery failed.'), $recip) . EOL);
}
}
notice( $total . t(' messages sent.') . EOL);
notice( sprintf( tt("%d message sent.", "%d messages sent.", $total) , $total) . EOL);
return;
}
@ -57,7 +57,7 @@ function invite_content(&$a) {
'$invite' => t('Send invitations'),
'$addr_text' => t('Enter email addresses, one per line:'),
'$msg_text' => t('Your message:'),
'$default_message' => t('Please join my social network on ') . $a->config['sitename'] . "\r\n" . "\r\n"
'$default_message' => sprintf(t('Please join my social network on %s'), $a->config['sitename']) . "\r\n" . "\r\n"
. t('To accept this invitation, please visit:') . "\r\n" . "\r\n" . $a->get_baseurl()
. "\r\n" . "\r\n" . t('Once you have registered, please connect with me via my profile page at:')
. "\r\n" . "\r\n" . $a->get_baseurl() . '/profile/' . $a->user['nickname'] ,

130
mod/item.php

@ -51,7 +51,7 @@ function item_post(&$a) {
}
$profile_uid = ((x($_POST,'profile_uid')) ? intval($_POST['profile_uid']) : 0);
$post_id = ((x($_POST['post_id'])) ? intval($_POST['post_id']) : 0);
if(! can_write_wall($a,$profile_uid)) {
notice( t('Permission denied.') . EOL) ;
@ -60,6 +60,21 @@ function item_post(&$a) {
killme();
}
// is this an edited post?
$orig_post = null;
if($post_id) {
$i = q("SELECT * FROM `item` WHERE `uid` = %d AND `id` = %d LIMIT 1",
intval($profile_uid),
intval($post_id)
);
if(! count($i))
killme();
$orig_post = $i[0];
}
$user = null;
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
@ -68,37 +83,51 @@ function item_post(&$a) {
if(count($r))
$user = $r[0];
$str_group_allow = perms2str($_POST['group_allow']);
$str_contact_allow = perms2str($_POST['contact_allow']);
$str_group_deny = perms2str($_POST['group_deny']);
$str_contact_deny = perms2str($_POST['contact_deny']);
$private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
if(($parent_item) &&
(($parent_item['private'])
|| strlen($parent_item['allow_cid'])
|| strlen($parent_item['allow_gid'])
|| strlen($parent_item['deny_cid'])
|| strlen($parent_item['deny_gid'])
)
) {
$private = 1;
if($orig_post) {
$str_group_allow = $orig_post['allow_gid'];
$str_contact_allow = $orig_post['allow_cid'];
$str_group_deny = $orig_post['deny_gid'];
$str_contact_deny = $orig_post['deny_cid'];
$title = $orig_post['title'];
$location = $orig_post['location'];
$coord = $orig_post['coord'];
$verb = $orig_post['verb'];
$emailcc = $orig_post['emailcc'];
$body = escape_tags(trim($_POST['body']));
$private = $orig_post['private'];
}
else {
$str_group_allow = perms2str($_POST['group_allow']);
$str_contact_allow = perms2str($_POST['contact_allow']);
$str_group_deny = perms2str($_POST['group_deny']);
$str_contact_deny = perms2str($_POST['contact_deny']);
$title = notags(trim($_POST['title']));
$location = notags(trim($_POST['location']));
$coord = notags(trim($_POST['coord']));
$verb = notags(trim($_POST['verb']));
$emailcc = notags(trim($_POST['emailcc']));
$body = escape_tags(trim($_POST['body']));
$private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
if(($parent_item) &&
(($parent_item['private'])
|| strlen($parent_item['allow_cid'])
|| strlen($parent_item['allow_gid'])
|| strlen($parent_item['deny_cid'])
|| strlen($parent_item['deny_gid'])
)) {
$private = 1;
}
$title = notags(trim($_POST['title']));
$body = escape_tags(trim($_POST['body']));
$location = notags(trim($_POST['location']));
$coord = notags(trim($_POST['coord']));
$verb = notags(trim($_POST['verb']));
$emailcc = notags(trim($_POST['emailcc']));
if(! strlen($body)) {
notice( t('Empty post discarded.') . EOL );
if(x($_POST,'return'))
goaway($a->get_baseurl() . "/" . $_POST['return'] );
killme();
if(! strlen($body)) {
notice( t('Empty post discarded.') . EOL );
if(x($_POST,'return'))
goaway($a->get_baseurl() . "/" . $_POST['return'] );
killme();
}
}
// get contact info for poster
@ -151,7 +180,6 @@ function item_post(&$a) {
}
}
/**
*
* When a photo was uploaded into the message using the (profile wall) ajax
@ -287,15 +315,13 @@ function item_post(&$a) {
$str_tags .= ',';
$str_tags .= '@[url=' . $alias . ']' . $newname . '[/url]';
}
}
}
}
}
$wall = 0;
if($post_type === 'wall' || $post_type === 'wall-comment')
$wall = 1;
@ -346,9 +372,31 @@ function item_post(&$a) {
$datarray['parent'] = $parent;
$datarray['self'] = $self;
if($orig_post)
$datarray['edit'] = true;
call_hooks('post_local',$datarray);
if($orig_post) {
$r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($body),
dbesc(datetime_convert()),
intval($post_id),
intval($profile_uid)
);
proc_run('php', "include/notifier.php", 'edit_post', "$post_id");
if((x($_POST,'return')) && strlen($_POST['return'])) {
logger('return: ' . $_POST['return']);
goaway($a->get_baseurl() . "/" . $_POST['return'] );
}
killme();
}
else
$post_id = 0;
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`,
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private` )
@ -423,8 +471,8 @@ function item_post(&$a) {
'$body' => strip_tags(bbcode($datarray['body']))
));
$res = mail($user['email'], $from . t(" commented on your item at ") . $a->config['sitename'],
$email_tpl,t("From: Administrator@") . $a->get_hostname() );
$res = mail($user['email'], sprintf( t("%s commented on your item at %s") ,$from,$a->config['sitename']),
$email_tpl,"From: " . t("Administrator") . "@" . $a->get_hostname() );
}
}
else {
@ -446,8 +494,8 @@ function item_post(&$a) {
'$body' => strip_tags(bbcode($datarray['body']))
));
$res = mail($user['email'], $from . t(" posted on your profile wall at ") . $a->config['sitename'],
$email_tpl,t("From: Administrator@") . $a->get_hostname() );
$res = mail($user['email'], sprintf( t("%s posted on your profile wall at %s") ,$from, $a->config['sitename']),
$email_tpl,"From: " . t("Administrator") . "@" . $a->get_hostname() );
}
}
@ -490,13 +538,13 @@ function item_post(&$a) {
$addr = trim($recip);
if(! strlen($addr))
continue;
$disclaimer = '<hr />' . t('This message was sent to you by ') . $a->user['username']
. t(', a member of the Friendika social network.') . '<br />';
$disclaimer = '<hr />' . sprintf(t('This message was sent to you by %s, a member of the Friendika social network.'),$a->user['username'])
. '<br />';
$disclaimer .= t('You may visit them online at') . ' '
. $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '<br />';
$disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . '<br />';
$subject = '[Friendika]' . ' ' . $a->user['username'] . ' ' . t('posted an update.');
$subject = '[Friendika]' . ' ' . sprintf( t('%s posted an update.'),$a->user['username']);
$headers = 'From: ' . $a->user['username'] . ' <' . $a->user['email'] . '>' . "\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";

12
mod/like.php

@ -124,9 +124,9 @@ function like_content(&$a) {
</object>
EOT;
if($verb === 'like')
$bodyverb = t('likes');
$bodyverb = t('%1$s likes %2$s\'s %3$s');
if($verb === 'dislike')
$bodyverb = t('doesn\'t like');
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
if(! isset($bodyverb))
return;
@ -147,9 +147,11 @@ EOT;
$arr['author-name'] = $contact['name'];
$arr['author-link'] = $contact['url'];
$arr['author-avatar'] = $contact['thumb'];
$arr['body'] = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . ' ' . $bodyverb . ' '
. '[url=' . $item['author-link'] . ']' . $item['author-name'] . t('\'s') . '[/url]' . ' '
. '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]' ;
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
$arr['verb'] = $activity;
$arr['object-type'] = $objtype;

2
mod/lostpass.php

@ -35,7 +35,7 @@ function lostpass_post(&$a) {
'$reset_link' => $a->get_baseurl() . '/lostpass?verify=' . $new_password
));
$res = mail($email, t('Password reset requested at ') . $a->config['sitename'],
$res = mail($email, sprintf(t('Password reset requested at %s'),$a->config['sitename']),
$email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME]);
goaway($a->get_baseurl());

2
mod/manage.php

@ -34,7 +34,7 @@ function manage_post(&$a) {
$_SESSION['page_flags'] = $r[0]['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname'];
notice( t("Welcome back ") . $r[0]['username'] . EOL);
notice( sprintf( t("Welcome back %s") , $r[0]['username']) . EOL);
$a->user = $r[0];
if(strlen($a->user['timezone'])) {

4
mod/network.php

@ -387,6 +387,9 @@ function network_content(&$a, $update = 0) {
));
}
$edpost = '';
if(($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
$edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo'];
@ -455,6 +458,7 @@ function network_content(&$a, $update = 0) {
'$owner_photo' => $owner_photo,
'$owner_name' => $owner_name,
'$plink' => get_plink($item),
'$edpost' => $edpost,
'$drop' => $drop,
'$vote' => $likebuttons,
'$like' => $like,

2
mod/openid.php

@ -70,7 +70,7 @@ function openid_content(&$a) {
$_SESSION['page_flags'] = $r[0]['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname'];
notice( t("Welcome back ") . $r[0]['username'] . EOL);
notice( sprintf( t("Welcome back "), $r[0]['username']) . EOL);
$a->user = $r[0];
if(strlen($a->user['timezone'])) {

1
mod/photos.php

@ -310,6 +310,7 @@ foreach($_FILES AS $key => $val) {
$arr['deny_gid'] = $p[0]['deny_gid'];
$arr['last-child'] = 1;
$arr['visible'] = $visibility;
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.jpg' . '[/img]'
. '[/url]';

7
mod/profile.php

@ -348,6 +348,12 @@ function profile_content(&$a, $update = 0) {
else
$sparkle = '';
$edpost = '';
if((local_user()) && ($a->profile['profile_uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
$edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
// We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a
// remote site (which could be down). We will use author-avatar if we haven't got something stored locally.
// We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any
@ -400,6 +406,7 @@ function profile_content(&$a, $update = 0) {
'$location' => $location,
'$indent' => $indent,
'$plink' => get_plink($item),
'$edpost' => $edpost,
'$drop' => $drop,
'$like' => $like,
'$vote' => $likebuttons,

10
mod/profile_photo.php

@ -58,21 +58,21 @@ function profile_photo_post(&$a) {
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, 1);
if($r === false)
notice ( t('Image size reduction [175] failed.') . EOL );
notice ( sprintf(t('Image size reduction [%s] failed.'),"175") . EOL );
$im->scaleImage(80);
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, 1);
if($r === false)
notice( t('Image size reduction [80] failed.') . EOL );
notice( sprintf(t('Image size reduction [%s] failed.'),"80") . EOL );
$im->scaleImage(48);
$r = $im->store(local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 6, 1);
if($r === false)
notice( t('Image size reduction [48] failed.') . EOL );
notice( sprintf(t('Image size reduction [%s] failed.'),"48") . EOL );
// Unset the profile photo flag from any other photos I own
@ -106,7 +106,7 @@ function profile_photo_post(&$a) {
$maximagesize = get_config('system','maximagesize');
if(($maximagesize) && ($filesize > $maximagesize)) {
notice( t('Image exceeds size limit of ') . $maximagesize . EOL);
notice( sprintf(t('Image exceeds size limit of %d'), $maximagesize) . EOL);
@unlink($src);
return;
}
@ -234,7 +234,7 @@ function profile_photo_crop_ui_head(&$a, $ph){
$r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 );
if($r === false)
notice( t('Image size reduction [640] failed.') . EOL );
notice( sprintf(t('Image size reduction [%s] failed.'),"640") . EOL );
else
$smallest = 1;
}

4
mod/register.php

@ -307,7 +307,7 @@ function register_post(&$a) {
'$password' => $new_password,
'$uid' => $newuid ));
$res = mail($email, t('Registration details for ') . $a->config['sitename'],
$res = mail($email, sprintf(t('Registration details for %s'), $a->config['sitename']),
$email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME']);
@ -344,7 +344,7 @@ function register_post(&$a) {
'$hash' => $hash
));
$res = mail($a->config['admin_email'], t('Registration request at ') . $a->config['sitename'],
$res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']),
$email_tpl,'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME']);
if($res) {

4
mod/regmod.php

@ -51,7 +51,7 @@ function regmod_content(&$a) {
$r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1",
dbesc($register[0]['hash'])
);
notice( t('Registration revoked for ') . $user[0]['username'] . EOL);
notice( sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
return;
}
@ -89,7 +89,7 @@ function regmod_content(&$a) {
'$uid' => $user[0]['uid']
));
$res = mail($user[0]['email'], t('Registration details for '). $a->config['sitename'],
$res = mail($user[0]['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
$email_tpl,'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] );
if($res) {

3
mod/viewcontacts.php

@ -41,9 +41,10 @@ function viewcontacts_content(&$a) {
$o .= replace_macros($tpl, array(
'$id' => $rr['id'],
'$alt_text' => t('Visit ') . $rr['name'] . t('\'s profile'),
'$alt_text' => t('Visit $username\'s profile'),
'$thumb' => $rr['thumb'],
'$name' => substr($rr['name'],0,20),
'$username' => $rr['name'],
'$url' => $rr['url']
));
}

2
mod/wall_upload.php

@ -53,7 +53,7 @@ function wall_upload_post(&$a) {
$maximagesize = get_config('system','maximagesize');
if(($maximagesize) && ($filesize > $maximagesize)) {
notice( t('Image exceeds size limit of ') . $maximagesize . EOL);
notice( sprintf(t('Image exceeds size limit of %d'), $maximagesize) . EOL);
@unlink($src);
return;
}

72
util/README

@ -44,5 +44,77 @@ then relocate the files to the view directory. The files in the top-level view
directory are template files which do not require translation.
Placeholders
Do not translate placeholders in strings! Things like %s, %d, %1$s and $somename
are used to add dynamic content to the string.
%s rappresent a dynamic string, like in "Welcome to %s"
%d rappresent a dynamic number, like in "%d new messages"
$somename is a variable like in php
In %1$s %2$s, the numbers are the position index of multiple dynamic content.
You could swap position in string of indexed placeholders.
e.g.
"%1$s's %2$s" => "John's photo", "John's item"
"%2$s di %1$s" => "foto di John", "elemento di John"
Plural
The tt() function supports plural form. Script extract.php write this in
strings.php as an array, one string for every plural form language supports:
$a->string["%d message sent"] = Array(
0 => "%d message sent",
1 => "%d messages sent",
);
The function string_plural_select($n) defined in strings.php, return the string
index to use, related to the numbers of item (value of $n).
This is modelled after ngettext function of GNU gettext.
More info at http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
Xgettext and .po workflow
1. Run utils/run_xgettext.sh script (on *unix sistems, with GNU xgettext installed)
This script runs xgettext on source tree, extracting strings from t() and tt()
functions, and creates a utils/messages.po file.
2. copy utils/messages.po to views/<langauage>/messages.po
3. open views/<langauage>/messages.po with a text editor and fill in infos in
"Last-Translator: FULL NAME <EMAIL@ADDRESS>"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
(eg:
"Last-Translator: Guybrush Threepwood <gb@host.com>"
"Language-Team: Pirate Friendika <pirate-friendika-ml@host.com>\n"
"Language: pi\n"
)
For the line
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
read GNU gettext manual at
http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
4. You could then translate the strings in text editor, but I suggest to use one
of the many .po editors out there, like QtLinguist
5. run
$ php utils/po2php.php views/<language>/messages.po
to create the strings.php file
When strings are added or modified in source, you could run
$ utils/run_xgettext.sh views/<language>/messages.po
to extraxt strings from source files and join them with the existing .po file:
new strings are added, the existing are not overwritten.
If you already translated Friendika using strings.php, you could import your old
translation to messages.po. Run:
$ php utils/php2po.php views/<language>/strings.php

47
util/extract.php

@ -10,25 +10,50 @@
$str = file_get_contents($file);
$pat = '| t\(([^\)]*)\)|';
$patt = '| tt\(([^\)]*)\)|';
preg_match_all($pat,$str,$matches);
if(! count($matches))
continue;
foreach($matches[1] as $match) {
if(! in_array($match,$arr))
$arr[] = $match;
preg_match_all($patt, $str, $matchestt);
if(count($matches)){
foreach($matches[1] as $match) {
if(! in_array($match,$arr))
$arr[] = $match;
}
}
if(count($matchestt)){
foreach($matchestt[1] as $match) {
$matchtkns = preg_split("|[ \t\r\n]*,[ \t\r\n]*|",$match);
if (count($matchtkns)==3 && !in_array($matchtkns,$arr)){
$arr[] = $matchtkns;
}
}
}
}
$s = '<?php' . "\n";
foreach($arr as $a) {
if(substr($a,0,1) == '$')
continue;
$s .= '
function string_plural_select($n){
return ($n != 1);
}
$s .= '$a->strings[' . $a . '] = ' . $a . ';' . "\n";
';
foreach($arr as $a) {
if (is_array($a)){
if(substr($a[1],0,1) == '$')
continue;
$s .= '$a->strings[' . $a[0] . "] = array(\n";
$s .= "\t0 => ". $a[0]. ",\n";
$s .= "\t1 => ". $a[1]. ",\n";
$s .= ");\n";
} else {
if(substr($a,0,1) == '$')
continue;
$s .= '$a->strings[' . $a . '] = '. $a . ';' . "\n";
}
}
$zones = timezone_identifiers_list();

2411
util/messages.po
File diff suppressed because it is too large
View File

71
util/php2po.php

@ -0,0 +1,71 @@
<?php
if(! class_exists('App')) {
class TmpA {
public $strings = Array();
}
$a = new TmpA();
}
if ($argc!=2) {
print "Usage: ".$argv[0]." <strings.php>\n\n";
return;
}
$phpfile = $argv[1];
$pofile = dirname($phpfile)."/messages.po";
if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
}
include_once($phpfile);
print "Out to '$pofile'\n";
$out = "";
$infile = file($pofile);
$k="";
$ink = False;
foreach ($infile as $l) {
if ($k!="" && substr($l,0,7)=="msgstr "){
$ink = False;
$v = '""';
//echo "DBG: k:'$k'\n";
if (isset($a->strings[$k])) {
$v= '"'.$a->strings[$k].'"';
//echo "DBG\n";
//var_dump($k, $v, $a->strings[$k], $v);
//echo "/DBG\n";
}
//echo "DBG: v:'$v'\n";
$l = "msgstr ".$v."\n";
}
if (substr($l,0,6)=="msgid_" || substr($l,0,7)=="msgstr[" )$ink = False;;
if ($ink) {
$k .= trim($l,"\"\r\n");
$k = str_replace('\"','"',$k);
}
if (substr($l,0,6)=="msgid "){
$arr=False;
$k = str_replace("msgid ","",$l);
if ($k != '""' ) {
$k = trim($k,"\"\r\n");
$k = str_replace('\"','"',$k);
} else {
$k = "";
}
$ink = True;
}
$out .= $l;
}
//echo $out;
file_put_contents($pofile, $out);
?>

103
util/po2php.php

@ -0,0 +1,103 @@
<?php
function po2php_run($argv, $argc) {
if ($argc!=2) {
print "Usage: ".$argv[0]." <file.po>\n\n";
return;
}
$pofile = $argv[1];
$outfile = dirname($pofile)."/strings.php";
if (!file_exists($pofile)){
print "Unable to find '$pofile'\n";
return;
}
print "Out to '$outfile'\n";
$out="<?php\n\n";
$infile = file($pofile);
$k="";
$v="";
$arr = False;
$ink = False;
$inv = False;
foreach ($infile as $l) {
$len = strlen($l);
if ($l[0]=="#") $l="";
if (substr($l,0,15)=='"Plural-Forms: '){
$match=Array();
preg_match("|nplurals=([0-9]*); plural=(.*);|", $l, $match);
$cond = str_replace('n','$n',$match[2]);
$out .= 'function string_plural_select($n){'."\n";
$out .= ' return '.$cond.';'."\n";
$out .= '}'."\n";
}
if ($k!="" && substr($l,0,7)=="msgstr "){
if ($ink) { $ink = False; $out .= '$a->strings["'.$k.'"] = '; }
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }
$v = substr($l,8,$len-10);
$inv = True;
//$out .= $v;
}
if ($k!="" && substr($l,0,7)=="msgstr["){
if ($ink) { $ink = False; $out .= '$a->strings["'.$k.'"] = '; }
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }
if (!$arr) {
$arr=True;
$out .= "array(\n";
}
$match=Array();
preg_match("|\[([0-9]*)\] (.*)|", $l, $match);
$out .= "\t". $match[1]." => ". $match[2] .",\n";
}
if (substr($l,0,6)=="msgid_") { $ink = False; $out .= '$a->strings["'.$k.'"] = '; };
if ($ink) {
$k .= trim($l,"\"\r\n");
//$out .= '$a->strings['.$k.'] = ';
}
if (substr($l,0,6)=="msgid "){
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }
if ($k!="") $out .= $arr?");\n":";\n";
$arr=False;
$k = str_replace("msgid ","",$l);
if ($k != '""' ) {
$k = trim($k,"\"\r\n");
} else {
$k = "";
}
$ink = True;
}
if ($inv && substr($l,0,6)!="msgstr") {
$v .= trim($l,"\"\r\n");
//$out .= '$a->strings['.$k.'] = ';
}
}
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }
if ($k!="") $out .= $arr?");\n":";\n";
file_put_contents($outfile, $out);
}
if (array_search(__file__,get_included_files())===0){
po2php_run($argv,$argc);
}

36
util/run_xgettext.sh

@ -0,0 +1,36 @@
#!/bin/bash
FULLPATH=$(dirname $(readlink -f "$0"))
cd "$FULLPATH/../view/en/"
F9KVERSION=$(sed -n "s/.*'FRIENDIKA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.php);
echo "Friendika version $F9KVERSION"
OPTS=