Skip to content

Commit

Permalink
[various] Rename group to circle
Browse files Browse the repository at this point in the history
- Drop support for group_text
- Add support for circle_text
  • Loading branch information
MrPetovan authored and heluecht committed Jun 3, 2023
1 parent 941b8c5 commit aa0f748
Show file tree
Hide file tree
Showing 45 changed files with 793 additions and 40 deletions.
64 changes: 64 additions & 0 deletions circle_text/group_text.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Name: Circle Text
* Description: Disable images in circle edit menu
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*/

use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;

function circle_text_install()
{
Hook::register('addon_settings', __FILE__, 'circle_text_settings');
Hook::register('addon_settings_post', __FILE__, 'circle_text_settings_post');
}

/**
*
* Callback from the settings post function.
* $post contains the $_POST array.
* We will make sure we've got a valid user account
* and if so set our configuration setting for this person.
*
*/

function circle_text_settings_post(array $post)
{
if (!DI::userSession()->getLocalUserId() || empty($post['circle_text-submit'])) {
return;
}

DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit', intval($post['circle_text']));
}


/**
*
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/

function circle_text_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
}

$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit') ??
DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit');

$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/circle_text/');
$html = Renderer::replaceMacros($t, [
'$enabled' => ['circle_text', DI::l10n()->t('Use a text only (non-image) circle selector in the "circle edit" menu'), $enabled],
]);

$data = [
'addon' => 'circle_text',
'title' => DI::l10n()->t('Circle Text'),
'html' => $html,
];
}
26 changes: 26 additions & 0 deletions circle_text/lang/C/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ADDON circle_text
# Copyright (C)
# This file is distributed under the same license as the Friendica circle_text addon package.
#
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-03 15:48-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: group_text.php:56
msgid "Use a text only (non-image) circle selector in the \"circle edit\" menu"
msgstr ""

#: group_text.php:61
msgid "Circle Text"
msgstr ""
32 changes: 32 additions & 0 deletions circle_text/lang/ar/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Farida Khalaf <[email protected]>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-02-21 02:59+0000\n"
"Last-Translator: Farida Khalaf <[email protected]>\n"
"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#: group_text.php:62
msgid "Group Text"
msgstr "نص المجموعة:"

#: group_text.php:64
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة \"تعديل المجموعة\""

#: group_text.php:70
msgid "Save Settings"
msgstr "حفظ الإعدادات"
10 changes: 10 additions & 0 deletions circle_text/lang/ar/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

if(! function_exists("string_plural_select_ar")) {
function string_plural_select_ar($n){
$n = intval($n);
if ($n==0) { return 0; } else if ($n==1) { return 1; } else if ($n==2) { return 2; } else if ($n%100>=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; }
}}
$a->strings['Group Text'] = 'نص المجموعة:';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة "تعديل المجموعة"';
$a->strings['Save Settings'] = 'حفظ الإعدادات';
36 changes: 36 additions & 0 deletions circle_text/lang/ca/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Joan Bar <[email protected]>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2019-10-14 00:45+0000\n"
"Last-Translator: Joan Bar <[email protected]>\n"
"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: group_text.php:46
msgid "Group Text settings updated."
msgstr "La configuració del text del grup s'ha actualitzat."

#: group_text.php:76
msgid "Group Text"
msgstr "Missatge del grup"

#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'"

#: group_text.php:84
msgid "Submit"
msgstr "sotmetre's"
11 changes: 11 additions & 0 deletions circle_text/lang/ca/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

if(! function_exists("string_plural_select_ca")) {
function string_plural_select_ca($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text settings updated.'] = 'La configuració del text del grup s\'ha actualitzat.';
$a->strings['Group Text'] = 'Missatge del grup';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú \'Edita grup\'';
$a->strings['Submit'] = 'sotmetre\'s';
37 changes: 37 additions & 0 deletions circle_text/lang/cs/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Aditoo, 2018
# michal_s <[email protected]>, 2014-2015
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2018-09-12 09:47+0000\n"
"Last-Translator: Aditoo\n"
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"

#: group_text.php:46
msgid "Group Text settings updated."
msgstr "Nastavení Group Text aktualizována."

#: group_text.php:76
msgid "Group Text"
msgstr "Skupinový text"

#: group_text.php:78
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin."

#: group_text.php:84
msgid "Submit"
msgstr "Odeslat"
11 changes: 11 additions & 0 deletions circle_text/lang/cs/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
}}
$a->strings['Group Text settings updated.'] = 'Nastavení Group Text aktualizována.';
$a->strings['Group Text'] = 'Skupinový text';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin.';
$a->strings['Submit'] = 'Odeslat';
28 changes: 28 additions & 0 deletions circle_text/lang/da-dk/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Anton <[email protected]>, 2022
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Anton <[email protected]>, 2022\n"
"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da_DK\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen"

#: group_text.php:63
msgid "Group Text"
msgstr "Gruppebesked"
9 changes: 9 additions & 0 deletions circle_text/lang/da-dk/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

if(! function_exists("string_plural_select_da_dk")) {
function string_plural_select_da_dk($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen';
$a->strings['Group Text'] = 'Gruppebesked';
31 changes: 31 additions & 0 deletions circle_text/lang/de/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Andreas H., 2014
# Tobias Diekershoff <[email protected]>, 2014
# Tobias Diekershoff <[email protected]>, 2021
# Ulf Rompe <[email protected]>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-21 19:14-0500\n"
"PO-Revision-Date: 2014-06-23 08:35+0000\n"
"Last-Translator: Tobias Diekershoff <[email protected]>, 2021\n"
"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: group_text.php:58
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Beim Bearbeiten von Gruppen Text statt Bilder anzeigen"

#: group_text.php:63
msgid "Group Text"
msgstr "Gruppen als Text"
9 changes: 9 additions & 0 deletions circle_text/lang/de/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Beim Bearbeiten von Gruppen Text statt Bilder anzeigen';
$a->strings['Group Text'] = 'Gruppen als Text';
5 changes: 5 additions & 0 deletions circle_text/lang/eo/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$a->strings["Group Text"] = "";
$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "";
$a->strings["Submit"] = "Sendi";
33 changes: 33 additions & 0 deletions circle_text/lang/es/messages.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ADDON group_text
# Copyright (C)
# This file is distributed under the same license as the Friendica group_text addon package.
#
#
# Translators:
# Albert, 2016
# Senex Petrovic <[email protected]>, 2021
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-01 18:15+0100\n"
"PO-Revision-Date: 2021-04-01 09:56+0000\n"
"Last-Translator: Senex Petrovic <[email protected]>\n"
"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: group_text.php:62
msgid "Group Text"
msgstr "Grupo de Texto"

#: group_text.php:64
msgid "Use a text only (non-image) group selector in the \"group edit\" menu"
msgstr "Utilice sólo el selector de grupo de texto (no imagen) en el menú \"edición de grupo\""

#: group_text.php:70
msgid "Save Settings"
msgstr "Guardar Ajustes"
10 changes: 10 additions & 0 deletions circle_text/lang/es/strings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
$n = intval($n);
return intval($n != 1);
}}
$a->strings['Group Text'] = 'Grupo de Texto';
$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilice sólo el selector de grupo de texto (no imagen) en el menú "edición de grupo"';
$a->strings['Save Settings'] = 'Guardar Ajustes';
Loading

0 comments on commit aa0f748

Please sign in to comment.