Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end i18n updates #1054

Merged
merged 3 commits into from
Oct 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions public/js/selfoss-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var selfoss = {
url: 'logout',
dataType: 'json',
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Could not log out: ' +
selfoss.ui.showError($('#lang').data('error_logout') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -318,7 +318,7 @@ var selfoss = {
selfoss.events.navigation();
},
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Load tags error: ' +
selfoss.ui.showError($('#lang').data('error_load_tags') + ' ' +
textStatus + ' ' + errorThrown);
},
complete: function() {
Expand All @@ -340,7 +340,7 @@ var selfoss = {
$('#nav-tags').append(tags);
if (selfoss.filter.tag) {
if (!selfoss.db.isValidTag(selfoss.filter.tag)) {
selfoss.ui.showError('Unknown tag: ' + selfoss.filter.tag);
selfoss.ui.showError($('#lang').data('error_unknown_tag') + ' ' + selfoss.filter.tag);
}

$('#nav-tags li:first').removeClass('active');
Expand Down Expand Up @@ -372,7 +372,7 @@ var selfoss = {
$('#nav-sources').append(sources);
if (selfoss.filter.source) {
if (!selfoss.db.isValidSource(selfoss.filter.source)) {
selfoss.ui.showError('Unknown source id: '
selfoss.ui.showError($('#lang').data('error_unknown_source') + ' '
+ selfoss.filter.source);
}

Expand Down Expand Up @@ -488,7 +488,7 @@ var selfoss = {
$('#content').removeClass('loading');
selfoss.ui.refreshStreamButtons(true, true, hadMore);
selfoss.events.entries();
selfoss.ui.showError('Can not mark all visible item: ' +
selfoss.ui.showError($('#lang').data('error_mark_items') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down
6 changes: 3 additions & 3 deletions public/js/selfoss-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ selfoss.dbOnline = {
selfoss.lastUpdate = dataDate;
},
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Could not sync last changes from server: ' +
selfoss.ui.showError($('#lang').data('error_sync') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -137,10 +137,10 @@ selfoss.dbOnline = {
if (textStatus == 'abort') {
return;
} else if (selfoss.hasSession() && errorThrown === 'Forbidden') {
selfoss.ui.showError('Your session has expired');
selfoss.ui.showError($('#lang').data('error_session_expired'));
selfoss.logout();
} else if (errorThrown) {
selfoss.ui.showError('Load list error: ' +
selfoss.ui.showError($('#lang').data('error_loading') + ' ' +
textStatus + ' ' + errorThrown);
}
selfoss.events.entries();
Expand Down
4 changes: 2 additions & 2 deletions public/js/selfoss-events-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ selfoss.events.entries = function() {
},
error: function(jqXHR, textStatus, errorThrown) {
streamMore.removeClass('loading');
selfoss.ui.showError('Load more error: ' +
selfoss.ui.showError($('#lang').data('error_loading') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -220,7 +220,7 @@ selfoss.events.entries = function() {
error: function(jqXHR, textStatus, errorThrown) {
content.html(articleList);
$('#content').removeClass('loading');
alert('Can not refresh source: ' + errorThrown);
alert($('#lang').data('error_refreshing_source') + ' ' + errorThrown);
}
});
});
Expand Down
4 changes: 2 additions & 2 deletions public/js/selfoss-events-entriestoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ selfoss.events.entriesToolbar = function(parent) {
// rollback ui changes
selfoss.ui.entryStarr(id, !starr);
updateStats(!starr);
selfoss.ui.showError('Can not star/unstar item: ' +
selfoss.ui.showError($('#lang').data('error_star_item') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -180,7 +180,7 @@ selfoss.events.entriesToolbar = function(parent) {
// rollback ui changes
selfoss.ui.entryMark(id, unread);
updateStats(!unread);
selfoss.ui.showError('Can not mark/unmark item: ' +
selfoss.ui.showError($('#lang').data('error_mark_item') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down
9 changes: 4 additions & 5 deletions public/js/selfoss-events-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ selfoss.events.navigation = function() {
selfoss.dbOnline.reloadList();
},
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Can not save new color: ' +
selfoss.ui.showError($('#lang').data('error_saving_color') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -121,7 +121,7 @@ selfoss.events.navigation = function() {
selfoss.refreshSources(data.sources);
},
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Can not load nav stats: ' +
selfoss.ui.showError($('#lang').data('error_loading_stats') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -173,17 +173,16 @@ selfoss.events.navigation = function() {

// probe stats and prompt reload to the user
selfoss.dbOnline.sync(true).done(function() {
var refreshed = 'Sources have been refreshed';
if ($('.unread-count').hasClass('unread')) {
selfoss.ui.showMessage(refreshed, 'Reload list',
selfoss.ui.showMessage($('#lang').data('sources_refreshed'), $('#lang').data('reload_list'),
function() {
$('#nav-filter-unread').click();
});
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
selfoss.ui.showError('Cannot refresh sources: ' + errorThrown);
selfoss.ui.showError($('#lang').data('error_refreshing_source') + ' ' + errorThrown);
},
complete: function() {
$('#nav-refresh').removeClass('loading');
Expand Down
4 changes: 2 additions & 2 deletions public/js/selfoss-events-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ selfoss.events.sources = function() {
},
error: function(jqXHR, textStatus, errorThrown) {
parent.find('.source-edit-delete').removeClass('loading');
selfoss.ui.showError('Error adding source: ' +
selfoss.ui.showError($('#lang').data('error_add_source') + ' ' +
textStatus + ' ' + errorThrown);
}
});
Expand Down Expand Up @@ -137,7 +137,7 @@ selfoss.events.sources = function() {
},
error: function(jqXHR, textStatus, errorThrown) {
parent.find('.source-edit-delete').removeClass('loading');
selfoss.ui.showError('Error deleting source: ' + errorThrown);
selfoss.ui.showError($('#lang').data('error_delete_source') + ' ' + errorThrown);
}
});
});
Expand Down
11 changes: 5 additions & 6 deletions public/js/selfoss-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ selfoss.events = {
selfoss.filter.sourcesNav = true;
}
} else if (selfoss.events.subsection != 'all') {
selfoss.ui.showError('Invalid subsection: '
selfoss.ui.showError($('#lang').data('error_invalid_subsection') + ' '
+ selfoss.events.subsection);
done();
return;
Expand All @@ -189,7 +189,7 @@ selfoss.events = {
selfoss.dbOnline.reloadList();
} else if (hash == 'sources') { // load sources
if (selfoss.events.subsection) {
selfoss.ui.showError('Invalid subsection: '
selfoss.ui.showError($('#lang').data('error_invalid_subsection') + ' '
+ selfoss.events.subsection);
done();
return;
Expand All @@ -198,7 +198,6 @@ selfoss.events = {
if (selfoss.activeAjaxReq !== null) {
selfoss.activeAjaxReq.abort();
}

selfoss.ui.refreshStreamButtons();
$('#content').addClass('loading').html('');
selfoss.activeAjaxReq = $.ajax({
Expand All @@ -212,10 +211,10 @@ selfoss.events = {
if (textStatus == 'abort') {
return;
} else if (selfoss.hasSession() && errorThrown === 'Forbidden') {
selfoss.ui.showError('Your session has expired');
selfoss.ui.showError($('#lang').data('error_session_expired'));
selfoss.logout();
} else if (errorThrown) {
selfoss.ui.showError('Load list error: ' +
selfoss.ui.showError($('#lang').data('error_loading') + ' ' +
textStatus + ' ' + errorThrown);
}
},
Expand All @@ -226,7 +225,7 @@ selfoss.events = {
} else if (hash == 'login') {
selfoss.ui.showLogin();
} else {
selfoss.ui.showError('Invalid section: ' + selfoss.events.section);
selfoss.ui.showError($('#lang').data('error_invalid_subsection') + ' ' + selfoss.events.section);
}
done();
},
Expand Down
18 changes: 18 additions & 0 deletions public/lang/cs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,21 @@ lang_login_invalid_credentials=špatné jméno nebo heslo
lang_no_title=Bez titulku
lang_error=nastala chyba
lang_streamerror=Nenačteny žádné položky, zkusit znovu?
lang_reload_list=Znovu načíst seznam
lang_sources_refreshed=Zdroje byly obnoveny
lang_error_session_expired=Vaše sezení vypršelo
lang_error_add_source=Zdroj nemohl být přidán:
lang_error_delete_source=Zdroj nemohl být smazán:
lang_error_load_tags=Štítky nemohly být načteny:
lang_error_unknown_tag=Neznámý štítek:
lang_error_unknown_source=Neznámé id zdroje:
lang_error_mark_items=Nelze označit všechny viditelné zdroje:
lang_error_mark_item=Nelze označit položku za (ne)přečtenou:
lang_error_star_item=Nelze o(d)značit položku hvězdičkou:
lang_error_logout=Odhlášení se nezdařilo:
lang_error_loading=Chyba načítání:
lang_error_loading_stats=Načítání statistik se nezdařilo:
lang_error_saving_color=Nelze změnit barvu:
lang_error_refreshing_source=Nelze obnovit zdroje:
lang_error_sync=Synchronizace změn ze serveru selhala:
lang_error_invalid_subsection=Podsekce neexistuje:
18 changes: 18 additions & 0 deletions public/lang/en.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,21 @@ lang_login_invalid_credentials=invalid username/password
lang_no_title=no title
lang_error=an error occured
lang_streamerror=No items loaded, reload?
lang_reload_list=Reload list
lang_sources_refreshed=Sources have been refreshed
lang_error_session_expired=Your session has expired
lang_error_add_source=Error adding source:
lang_error_delete_source=Error deleting source:
lang_error_load_tags=Load tags error:
lang_error_unknown_tag=Unknown tag:
lang_error_unknown_source=Unknown source id:
lang_error_mark_items=Can not mark all visible items:
lang_error_mark_item=Can not mark/unmark item:
lang_error_star_item=Can not star/unstar item:
lang_error_logout=Could not log out:
lang_error_loading=Loading error:
lang_error_loading_stats=Cannot load nav stats:
lang_error_saving_color=Cannot save new color:
lang_error_refreshing_source=Cannot refresh sources:
lang_error_sync=Could not sync last changes from server:
lang_error_invalid_subsection=Invalid subsection:
48 changes: 33 additions & 15 deletions public/lang/fr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@ lang_filter=Filtres
lang_newest=Tous
lang_unread=Non lus
lang_starred=Favoris
lang_tags=Étiquettes
lang_alltags=Toutes les étiquettes
lang_tags=Tags
lang_alltags=Tous les tags
lang_timestamp={0,date} {0,time}
lang_days={0,plural,zero {aujourd'hui},one {hier},other {il y a # jours}}
lang_hours=il y a {0,plural,one {1 heure},other {# heures}}
lang_minutes=il y a {0,plural,one {1 minute},other {# minutes}}
lang_seconds=il y a {0,plural,one {1 seconde},other {# secondes}}
lang_star=Favori
lang_unstar=Non favori
lang_mark=Non lu
lang_unmark=Lu
lang_load_img=Voir les images
lang_days={0,plural,zero {aujourd’hui},one {hier},other {il y a # jours}}
lang_star=Ajouter aux favoris
lang_unstar=Supprimer des favoris
lang_mark=Marquer comme lu
lang_unmark=Marquer comme non lu
lang_load_img=Afficher les images
lang_open_window=Ouvrir
lang_next=Suivant
lang_searchbutton=Rechercher
lang_searchremove=Fermer le champ de recherche
lang_refreshbutton=Mettre à jour les sources
lang_refreshbutton=Rafraîchir les sources
lang_settingsbutton=Paramètres
lang_loginbutton=Se connecter
lang_logoutbutton=Se déconnecter
lang_loginbutton=Se connecter
lang_sources=Sources
lang_source_add=Ajouter une source
lang_source_opml=ou importer un fichier OPML ou Google Reader
lang_source_export=Exporter les sources au format OPML
lang_source_edit=Modifier
lang_source_filter=Filtre 
lang_source_delete=Supprimer
lang_source_warn=Confirmer la suppression de cette source.
lang_source_warn=Confirmez-vous la suppression de cette source ?
lang_source_new=Nouvelle source non sauvegardée
lang_source_title=Titre 
lang_source_autotitle_hint=Laisser vide pour récupérer le titre
lang_source_tags=Étiquettes 
lang_source_tags=Tags 
lang_source_pwd_placeholder=Mot de passe inchangé
lang_source_comma=Séparées par une virgule
lang_source_comma=Séparés par une virgule
lang_source_select=Sélectionner une source
lang_source_type=Type 
lang_source_save=Sauvegarder
lang_source_cancel=Annuler
lang_source_saved=Source sauvegardée
lang_source_last_post=Dernier élément vu
lang_source_refresh=Mettre à jour cette source
lang_no_entries=Il n’y a aucun article à consulter
lang_source_refresh=Rafraîchir cette source
lang_no_entries=Aucun article à consulter
lang_more=Suite
lang_login=Connexion
lang_login_username=Identifiant 
Expand All @@ -53,3 +53,21 @@ lang_login_invalid_credentials=Nom d’utilisateur/Mot de passe incorrects
lang_no_title=Sans titre
lang_error=Une erreur est survenue
lang_streamerror=Une erreur s’est produite lors du chargement de la liste, essayer à nouveau ?
lang_reload_list=Recharger la liste
lang_sources_refreshed=Les sources ont été rafraichies
lang_error_session_expired=Votre session a expiré
lang_error_add_source=Erreur lors de l’ajout de la source :
lang_error_delete_source=Erreur lors de la suppression de la source :
lang_error_load_tags=Erreur lors du chargement des tags :
lang_error_unknown_tag=Tag inconnu :
lang_error_unknown_source=Identifiant de source inconnu :
lang_error_mark_items=Impossible de marquer tous les éléments visibles :
lang_error_mark_item=Erreur lors du marquage lu/non lu :
lang_error_star_item=Erreur lors de l’ajouter/suppression du favori :
lang_error_logout=Impossible de se déconnecter :
lang_error_loading=Erreur de chargement :
lang_error_loading_stats=Impossible de charger les statistiques de navigation :
lang_error_saving_color=Impossible de sauvegarder une nouvelle couleur :
lang_error_refreshing_source=Impossible de rafraîchir les sources :
lang_error_sync=Impossible de synchroniser les dernières modifications du serveur :
lang_error_invalid_subsection=Sous-section non valide :
18 changes: 18 additions & 0 deletions templates/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@
data-source_warn="<?= \F3::get('lang_source_warn'); ?>"
data-source_saved="<?= \F3::get('lang_source_saved'); ?>"
data-source_edit="<?= \F3::get('lang_source_edit'); ?>"
data-reload_list="<?= \F3::get('lang_reload_list'); ?>"
data-sources_refreshed="<?= \F3::get('lang_sources_refreshed'); ?>"
data-error_session_expired="<?= \F3::get('lang_error_session_expired'); ?>"
data-error_add_source="<?= \F3::get('lang_error_add_source'); ?>"
data-error_delete_source="<?= \F3::get('lang_error_delete_source'); ?>"
data-error_load_tags="<?= \F3::get('lang_error_load_tags'); ?>"
data-error_unknown_tag="<?= \F3::get('lang_error_unknown_tag'); ?>"
data-error_unknown_source="<?= \F3::get('lang_error_unknown_source'); ?>"
data-error_mark_items="<?= \F3::get('lang_error_mark_items'); ?>"
data-error_mark_item="<?= \F3::get('lang_error_mark_item'); ?>"
data-error_star_item="<?= \F3::get('lang_error_star_item'); ?>"
data-error_logout="<?= \F3::get('lang_error_logout'); ?>"
data-error_loading="<?= \F3::get('lang_error_loading'); ?>"
data-error_loading_stats="<?= \F3::get('lang_error_loading_stats'); ?>"
data-error_saving_color="<?= \F3::get('lang_error_saving_color'); ?>"
data-error_refreshing_source="<?= \F3::get('lang_error_refreshing_source'); ?>"
data-error_sync="<?= \F3::get('lang_error_sync'); ?>"
data-error_invalid_subsection="<?= \F3::get('lang_error_invalid_subsection'); ?>"
data-seconds="<?= \F3::get('lang_seconds'); ?>"
data-minutes="<?= \F3::get('lang_minutes'); ?>"
data-hours="<?= \F3::get('lang_hours'); ?>"></span>
Expand Down