1
0
Fork 0

Move L10n::t() calls to DI::l10n()->t() calls

This commit is contained in:
Philipp Holzer 2020-01-18 20:52:34 +01:00
commit 5dfee31108
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
175 changed files with 2841 additions and 2841 deletions

View file

@ -51,13 +51,13 @@ function theme_admin_post(App $a)
function clean_form(App $a, &$colorset, $user)
{
$colorset = [
'default' => L10n::t('default'),
'greenzero' => L10n::t('greenzero'),
'purplezero' => L10n::t('purplezero'),
'easterbunny' => L10n::t('easterbunny'),
'darkzero' => L10n::t('darkzero'),
'comix' => L10n::t('comix'),
'slackr' => L10n::t('slackr'),
'default' => DI::l10n()->t('default'),
'greenzero' => DI::l10n()->t('greenzero'),
'purplezero' => DI::l10n()->t('purplezero'),
'easterbunny' => DI::l10n()->t('easterbunny'),
'darkzero' => DI::l10n()->t('darkzero'),
'comix' => DI::l10n()->t('comix'),
'slackr' => DI::l10n()->t('slackr'),
];
if ($user) {
@ -68,9 +68,9 @@ function clean_form(App $a, &$colorset, $user)
$t = Renderer::getMarkupTemplate("theme_settings.tpl");
$o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Submit'),
'$title' => L10n::t("Theme settings"),
'$colorset' => ['duepuntozero_colorset', L10n::t('Variations'), $color, '', $colorset],
'$submit' => DI::l10n()->t('Submit'),
'$title' => DI::l10n()->t("Theme settings"),
'$colorset' => ['duepuntozero_colorset', DI::l10n()->t('Variations'), $color, '', $colorset],
]);
return $o;

View file

@ -107,7 +107,7 @@ function frio_form($arr)
}
$scheme_choices = [];
$scheme_choices['---'] = L10n::t('Custom');
$scheme_choices['---'] = DI::l10n()->t('Custom');
$files = glob('view/theme/frio/scheme/*.php');
if ($files) {
foreach ($files as $file) {
@ -119,31 +119,31 @@ function frio_form($arr)
}
}
$background_image_help = '<strong>' . L10n::t('Note') . ': </strong>' . L10n::t('Check image permissions if all users are allowed to see the image');
$background_image_help = '<strong>' . DI::l10n()->t('Note') . ': </strong>' . DI::l10n()->t('Check image permissions if all users are allowed to see the image');
$t = Renderer::getMarkupTemplate('theme_settings.tpl');
$ctx = [
'$submit' => L10n::t('Submit'),
'$title' => L10n::t('Theme settings'),
'$scheme' => ['frio_scheme', L10n::t('Select color scheme'), $arr['scheme'], '', $scheme_choices],
'$share_string' => ['frio_share_string', L10n::t('Copy or paste schemestring'), $arr['share_string'], L10n::t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false],
'$nav_bg' => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', L10n::t('Navigation bar background color'), $arr['nav_bg'], '', false],
'$nav_icon_color' => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color'], '', false],
'$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', false],
'$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', L10n::t('Set the background color'), $arr['background_color'], '', false],
'$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), ($arr['contentbg_transp'] ?? 0) ?: 100, ''],
'$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help, false],
'$bg_image_options_title' => L10n::t('Background image style'),
'$submit' => DI::l10n()->t('Submit'),
'$title' => DI::l10n()->t('Theme settings'),
'$scheme' => ['frio_scheme', DI::l10n()->t('Select color scheme'), $arr['scheme'], '', $scheme_choices],
'$share_string' => ['frio_share_string', DI::l10n()->t('Copy or paste schemestring'), $arr['share_string'], DI::l10n()->t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false],
'$nav_bg' => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', DI::l10n()->t('Navigation bar background color'), $arr['nav_bg'], '', false],
'$nav_icon_color' => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', DI::l10n()->t('Navigation bar icon color '), $arr['nav_icon_color'], '', false],
'$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', DI::l10n()->t('Link color'), $arr['link_color'], '', false],
'$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', DI::l10n()->t('Set the background color'), $arr['background_color'], '', false],
'$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', DI::l10n()->t('Content background opacity'), ($arr['contentbg_transp'] ?? 0) ?: 100, ''],
'$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', DI::l10n()->t('Set the background image'), $arr['background_image'], $background_image_help, false],
'$bg_image_options_title' => DI::l10n()->t('Background image style'),
'$bg_image_options' => Image::get_options($arr),
'$enable_compose' => ['frio_enable_compose', L10n::t('Enable Compose page'), $arr['enable_compose'], L10n::t('This replaces the jot modal window for writing new posts with a link to <a href="compose">the new Compose page</a>.')],
'$enable_compose' => ['frio_enable_compose', DI::l10n()->t('Enable Compose page'), $arr['enable_compose'], DI::l10n()->t('This replaces the jot modal window for writing new posts with a link to <a href="compose">the new Compose page</a>.')],
];
if (array_key_exists('login_bg_image', $arr) && !array_key_exists('login_bg_image', $disable)) {
$ctx['$login_bg_image'] = ['frio_login_bg_image', L10n::t('Login page background image'), $arr['login_bg_image'], $background_image_help, false];
$ctx['$login_bg_image'] = ['frio_login_bg_image', DI::l10n()->t('Login page background image'), $arr['login_bg_image'], $background_image_help, false];
}
if (array_key_exists('login_bg_color', $arr) && !array_key_exists('login_bg_color', $disable)) {
$ctx['$login_bg_color'] = ['frio_login_bg_color', L10n::t('Login page background color'), $arr['login_bg_color'], L10n::t('Leave background image and color empty for theme defaults'), false];
$ctx['$login_bg_color'] = ['frio_login_bg_color', DI::l10n()->t('Login page background color'), $arr['login_bg_color'], DI::l10n()->t('Leave background image and color empty for theme defaults'), false];
}
$o = Renderer::replaceMacros($t, $ctx);

View file

@ -21,10 +21,10 @@ class Image
public static function get_options($arr)
{
$bg_image_options = [
'stretch' => ['frio_bg_image_option', L10n::t('Top Banner'), 'stretch', L10n::t('Resize image to the width of the screen and show background color below on long pages.'), ($arr['bg_image_option'] == 'stretch')],
'cover' => ['frio_bg_image_option', L10n::t('Full screen'), 'cover', L10n::t('Resize image to fill entire screen, clipping either the right or the bottom.'), ($arr['bg_image_option'] == 'cover')],
'contain' => ['frio_bg_image_option', L10n::t('Single row mosaic'), 'contain', L10n::t('Resize image to repeat it on a single row, either vertical or horizontal.'), ($arr['bg_image_option'] == 'contain')],
'repeat' => ['frio_bg_image_option', L10n::t('Mosaic'), 'repeat', L10n::t('Repeat image to fill the screen.'), ($arr['bg_image_option'] == 'repeat')],
'stretch' => ['frio_bg_image_option', DI::l10n()->t('Top Banner'), 'stretch', DI::l10n()->t('Resize image to the width of the screen and show background color below on long pages.'), ($arr['bg_image_option'] == 'stretch')],
'cover' => ['frio_bg_image_option', DI::l10n()->t('Full screen'), 'cover', DI::l10n()->t('Resize image to fill entire screen, clipping either the right or the bottom.'), ($arr['bg_image_option'] == 'cover')],
'contain' => ['frio_bg_image_option', DI::l10n()->t('Single row mosaic'), 'contain', DI::l10n()->t('Resize image to repeat it on a single row, either vertical or horizontal.'), ($arr['bg_image_option'] == 'contain')],
'repeat' => ['frio_bg_image_option', DI::l10n()->t('Mosaic'), 'repeat', DI::l10n()->t('Repeat image to fill the screen.'), ($arr['bg_image_option'] == 'repeat')],
];
return $bg_image_options;

View file

@ -244,12 +244,12 @@ function frio_remote_nav($a, &$nav)
$r[0]['name'] = $a->user['username'];
} elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
$nav['remote'] = L10n::t('Guest');
$nav['remote'] = DI::l10n()->t('Guest');
} elseif (Model\Profile::getMyURL()) {
$r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
WHERE `addr` = '%s' AND `network` = 'dfrn'",
DBA::escape($webbie));
$nav['remote'] = L10n::t('Visitor');
$nav['remote'] = DI::l10n()->t('Visitor');
} else {
$r = false;
}
@ -265,18 +265,18 @@ function frio_remote_nav($a, &$nav)
if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
// user menu
$nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
$nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
$nav['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], L10n::t('Photos'), '', L10n::t('Your photos')];
$nav['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], L10n::t('Videos'), '', L10n::t('Your videos')];
$nav['usermenu'][] = [$server_url . '/events/', L10n::t('Events'), '', L10n::t('Your events')];
$nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
$nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '?tab=profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
$nav['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')];
$nav['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')];
$nav['usermenu'][] = [$server_url . '/events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')];
// navbar links
$nav['network'] = [$server_url . '/network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
$nav['events'] = [$server_url . '/events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
$nav['messages'] = [$server_url . '/message', L10n::t('Messages'), '', L10n::t('Private mail')];
$nav['settings'] = [$server_url . '/settings', L10n::t('Settings'), '', L10n::t('Account settings')];
$nav['contacts'] = [$server_url . '/contact', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
$nav['network'] = [$server_url . '/network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
$nav['events'] = [$server_url . '/events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
$nav['messages'] = [$server_url . '/message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')];
$nav['settings'] = [$server_url . '/settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')];
$nav['contacts'] = [$server_url . '/contact', DI::l10n()->t('Contacts'), '', DI::l10n()->t('Manage/edit friends and contacts')];
$nav['sitename'] = Config::get('config', 'sitename');
}
}
@ -361,7 +361,7 @@ function frio_display_item(App $a, &$arr)
{
$subthread = [
'menu' => 'follow_thread',
'title' => L10n::t('Follow Thread'),
'title' => DI::l10n()->t('Follow Thread'),
'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
'href' => '#'
];

View file

@ -70,12 +70,12 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) {
$t = Renderer::getMarkupTemplate("theme_settings.tpl" );
$o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Submit'),
'$title' => L10n::t("Theme settings"),
'$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
'$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
'$pfs' => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
'$tfs' => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],
'$submit' => DI::l10n()->t('Submit'),
'$title' => DI::l10n()->t("Theme settings"),
'$align' => ['quattro_align', DI::l10n()->t('Alignment'), $align, '', ['left' => DI::l10n()->t('Left'), 'center' => DI::l10n()->t('Center')]],
'$color' => ['quattro_color', DI::l10n()->t('Color scheme'), $color, '', $colors],
'$pfs' => ['quattro_pfs', DI::l10n()->t('Posts font size'), $pfs],
'$tfs' => ['quattro_tfs', DI::l10n()->t('Textareas font size'), $tfs],
]);
return $o;
}

View file

@ -74,7 +74,7 @@ function theme_admin(App $a) {
$t = Renderer::getMarkupTemplate("theme_admin_settings.tpl");
$o = Renderer::replaceMacros($t, [
'$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
'$helperlist' => ['vier_helperlist', DI::l10n()->t('Comma separated list of helper forums'), $helperlist, '', ''],
]);
$show_pages = get_vier_config('show_pages', true, true);
@ -114,19 +114,19 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $
"shadow"=>"Shadow"
];
$show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
$show_or_not = ['0' => DI::l10n()->t("don't show"), '1' => DI::l10n()->t("show"),];
$t = Renderer::getMarkupTemplate("theme_settings.tpl");
$o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Submit'),
'$title' => L10n::t("Theme settings"),
'$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles],
'$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],
'$show_profiles' => ['vier_show_profiles', L10n::t('Community Profiles'), $show_profiles, '', $show_or_not],
'$show_helpers' => ['vier_show_helpers', L10n::t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
'$show_services' => ['vier_show_services', L10n::t('Connect Services'), $show_services, '', $show_or_not],
'$show_friends' => ['vier_show_friends', L10n::t('Find Friends'), $show_friends, '', $show_or_not],
'$show_lastusers' => ['vier_show_lastusers', L10n::t('Last users'), $show_lastusers, '', $show_or_not]
'$submit' => DI::l10n()->t('Submit'),
'$title' => DI::l10n()->t("Theme settings"),
'$style' => ['vier_style', DI::l10n()->t('Set style'), $style, '', $styles],
'$show_pages' => ['vier_show_pages', DI::l10n()->t('Community Pages'), $show_pages, '', $show_or_not],
'$show_profiles' => ['vier_show_profiles', DI::l10n()->t('Community Profiles'), $show_profiles, '', $show_or_not],
'$show_helpers' => ['vier_show_helpers', DI::l10n()->t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
'$show_services' => ['vier_show_services', DI::l10n()->t('Connect Services'), $show_services, '', $show_or_not],
'$show_friends' => ['vier_show_friends', DI::l10n()->t('Find Friends'), $show_friends, '', $show_or_not],
'$show_lastusers' => ['vier_show_lastusers', DI::l10n()->t('Last users'), $show_lastusers, '', $show_or_not]
]);
return $o;
}

View file

@ -125,7 +125,7 @@ function vier_community_info()
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
if (DBA::isResult($r)) {
$aside['$comunity_profiles_title'] = L10n::t('Community Profiles');
$aside['$comunity_profiles_title'] = DI::l10n()->t('Community Profiles');
$aside['$comunity_profiles_items'] = [];
foreach ($r as $rr) {
@ -155,7 +155,7 @@ function vier_community_info()
);
if (DBA::isResult($r)) {
$aside['$lastusers_title'] = L10n::t('Last users');
$aside['$lastusers_title'] = DI::l10n()->t('Last users');
$aside['$lastusers_items'] = [];
foreach ($r as $rr) {
@ -173,18 +173,18 @@ function vier_community_info()
//right_aside FIND FRIENDS
if ($show_friends && local_user()) {
$nv = [];
$nv['findpeople'] = L10n::t('Find People');
$nv['desc'] = L10n::t('Enter name or interest');
$nv['label'] = L10n::t('Connect/Follow');
$nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing');
$nv['findthem'] = L10n::t('Find');
$nv['suggest'] = L10n::t('Friend Suggestions');
$nv['similar'] = L10n::t('Similar Interests');
$nv['random'] = L10n::t('Random Profile');
$nv['inv'] = L10n::t('Invite Friends');
$nv['directory'] = L10n::t('Global Directory');
$nv['findpeople'] = DI::l10n()->t('Find People');
$nv['desc'] = DI::l10n()->t('Enter name or interest');
$nv['label'] = DI::l10n()->t('Connect/Follow');
$nv['hint'] = DI::l10n()->t('Examples: Robert Morgenstein, Fishing');
$nv['findthem'] = DI::l10n()->t('Find');
$nv['suggest'] = DI::l10n()->t('Friend Suggestions');
$nv['similar'] = DI::l10n()->t('Similar Interests');
$nv['random'] = DI::l10n()->t('Random Profile');
$nv['inv'] = DI::l10n()->t('Invite Friends');
$nv['directory'] = DI::l10n()->t('Global Directory');
$nv['global_dir'] = Search::getGlobalDirectory();
$nv['local_directory'] = L10n::t('Local Directory');
$nv['local_directory'] = DI::l10n()->t('Local Directory');
$aside['$nv'] = $nv;
}
@ -224,12 +224,12 @@ function vier_community_info()
$page = Renderer::replaceMacros(
$tpl,
[
'$title' => L10n::t('Forums'),
'$title' => DI::l10n()->t('Forums'),
'$forums' => $entries,
'$link_desc' => L10n::t('External link to forum'),
'$link_desc' => DI::l10n()->t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
'$showmore' => L10n::t('show more')]
'$showmore' => DI::l10n()->t('show more')]
);
$aside['$page'] = $page;
@ -262,13 +262,13 @@ function vier_community_info()
$r[$index]["url"] = Contact::magicLink($helper["url"]);
}
$r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];
$r[] = ["url" => "help/Quick-Start-guide", "name" => DI::l10n()->t("Quick Start")];
$tpl = Renderer::getMarkupTemplate('ch_helpers.tpl');
if ($r) {
$helpers = [];
$helpers['title'] = ["", L10n::t('Help'), "", ""];
$helpers['title'] = ["", DI::l10n()->t('Help'), "", ""];
$aside['$helpers_items'] = [];
@ -347,7 +347,7 @@ function vier_community_info()
if (DBA::isResult($r)) {
$con_services = [];
$con_services['title'] = ["", L10n::t('Connect Services'), "", ""];
$con_services['title'] = ["", DI::l10n()->t('Connect Services'), "", ""];
$aside['$con_services'] = $con_services;
foreach ($r as $rr) {