Skip to content

Commit df65958

Browse files
math-GHAlkarex
andauthored
Improve (#3)
* improve readme.md * about page * fix title of about page * i18n en * i18n fr * added: i18n de * readme: CSS+JS * Apply suggestion from @Alkarex * Apply suggestion from @Alkarex --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
1 parent a017181 commit df65958

9 files changed

Lines changed: 139 additions & 10 deletions

File tree

Controllers/indexController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
class FreshExtension_index_Controller extends FreshRSS_index_Controller {
44
public function aboutAction() {
5-
Minz_View::prependTitle(_t('ext.about.new_title') . ' · ');
5+
Minz_View::prependTitle(_t('ext.hello_world.about.title') . ' · ');
66
}
77
}

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
Extension-HelloWorld
2-
====================
1+
# Extension-HelloWorld
32

4-
An HelloWorld extension
3+
An HelloWorld extension for [FreshRSS](https://github.com/FreshRSS/FreshRSS).
4+
5+
It is a bit described in the documentation: https://freshrss.github.io/FreshRSS/en/developers/03_Backend/05_Extensions.html#write-an-extension-for-freshrss
6+
7+
## Warning
8+
9+
It is not recommended to install this extension on your production server. This extension manipulates the important “About” page.
10+
11+
## How to install
12+
13+
To install this extension, download the extension archive first and extract it on your PC. Then, upload this on your server. Extensions must be in the `./extensions` directory of your FreshRSS installation.
14+
15+
## What it does
16+
17+
This extension is a little showcase and boilerplate for a FreshRSS extension.
18+
19+
As showcase it will manipulate some little things:
20+
- the “About” page content will be overwritten
21+
- the “Save” button titles will be changed
22+
- the normal view article list will be changed
23+
- it loads a CSS and a JavaScript file

i18n/de/ext.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
13+
return array(
14+
'hello_world' => array(
15+
'no_configuration' => 'Hier kann leider nichts konfiguriert werden!',
16+
'about' => array (
17+
'title' => 'Über: Hello World FreshRSS',
18+
'content' => 'Eine neue „Über“ Seite, die von der Erweiterung „xExtension-HelloWorld“ überschrieben wurde'
19+
),
20+
),
21+
);

i18n/de/gen.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
13+
return array(
14+
'action' => array(
15+
'submit' => 'OK Hello World!', // IGNORE
16+
),
17+
'menu' => array(
18+
'about' => 'Über FreshRSS und Hello World',
19+
),
20+
);

i18n/en/ext.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
<?php
22

3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
313
return array(
414
'hello_world' => array(
515
'no_configuration' => 'There is nothing to configure in this extension, sorry!',
16+
'about' => array (
17+
'title' => 'About: Hello World FreshRSS',
18+
'content' => 'A new about page that was overwritten by the extension “xExtension-HelloWorld”'
19+
),
620
),
721
);

i18n/en/gen.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
<?php
22

3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
313
return array(
414
'action' => array(
5-
'submit' => 'Save',
15+
'submit' => 'OK Hello World!',
16+
),
17+
'menu' => array(
18+
'about' => 'About FreshRSS and Hello World',
619
),
720
);

i18n/fr/ext.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
<?php
22

3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
313
return array(
414
'hello_world' => array(
515
'no_configuration' => 'Il n’y a rien à configurer dans cette extension, désolé !',
616
),
17+
'about' => array (
18+
'title' => 'À propos : Hello World FreshRSS',
19+
'content' => 'Une nouvelle page « À propos » qui a été modifiée par l’extension « xExtension-HelloWorld ».'
20+
),
721
);

i18n/fr/gen.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
<?php
22

3+
/******************************************************************************/
4+
/* Each entry of that file can be associated with a comment to indicate its */
5+
/* state. When there is no comment, it means the entry is fully translated. */
6+
/* The recognized comments are (comment matching is case-insensitive): */
7+
/* + TODO: the entry has never been translated. */
8+
/* + DIRTY: the entry has been translated but needs to be updated. */
9+
/* + IGNORE: the entry does not need to be translated. */
10+
/* When a comment is not recognized, it is discarded. */
11+
/******************************************************************************/
12+
313
return array(
414
'action' => array(
5-
'submit' => 'Sauvegarder',
15+
'submit' => 'OK Hello World!', // TODO
16+
),
17+
'menu' => array(
18+
'about' => 'À propos FreshRSS et « HelloWorld »',
619
),
720
);

views/index/about.phtml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
<div class="post content">
2-
<h1>About</h1>
3-
<p>A new about page!</p>
4-
</div>
1+
<?php
2+
/** @var FreshRSS_View $this */
3+
if (FreshRSS_Auth::hasAccess()) {
4+
$this->partial('aside_configure');
5+
}
6+
?>
7+
8+
<main class="post content<?= !FreshRSS_Auth::hasAccess() ? ' centered' : ''?>">
9+
<h1><?= _t('ext.hello_world.about.title')?></h1>
10+
<p><?= _t('ext.hello_world.about.content')?></p>
11+
</main>
12+
13+
<?php if (!FreshRSS_Auth::hasAccess()) { ?>
14+
<footer class="main-footer">
15+
<?php if (file_exists(TOS_FILENAME)) { ?>
16+
<a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
17+
<?php } ?>
18+
</footer>
19+
<?php } ?>

0 commit comments

Comments
 (0)