|
|
|
| Apache |
|
|
| Boz PHP - Another PHP Framework |
|
|
| Debian GNU/Linux |
|
|
| jQuery + jQuery UI |
|
|
| Leaflet |
|
|
| Materialize |
|
|
| Material Design Icons |
|
|
| MySQL |
Relational database management system |
|
| Open Data MISE |
|
|
| OpenStreetMap |
|
|
| OpenClipArt |
|
|
| PHP |
|
|
| Reveal.JS |
|
|
.
*/
/**
* It do what it's written.
* @param float $latitude1
* @param float $longitude1
* @param float $latitude2
* @param float $longitude2
* @return float Meters
*/
function get_distance_between_coordinates($latitude1, $longitude1, $latitude2, $longitude2) {
$theta = $longitude1 - $longitude2;
$distance = sin(deg2rad($latitude1)) * sin(deg2rad($latitude2)) + (
cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))
);
$distance = acos($distance);
$distance = rad2deg($distance) * 60 * 1.1515;
$distance = $distance * 1609.344; // To meters
return $distance;
}
function get_in_touch($url, $who) {
return HTML::a($url, mdi_icon('perm_contact_calendar') . _("Entra in contatto"), sprintf( _("Mettiti in contatto con %s"), $who ), 'waves-effect waves-teal btn');
}
function legal_notes($url, $license, $project) {
- return HTML::a($url, $license, sprintf( _("Informazioni legali su %s"), $project ), 'waves-effect waves-teal btn-flat' );
+ return HTML::a($url, $license, sprintf( _("Informazioni legali su %s"), $project ) );
}
function mdi_icon($uid, $class = 'left') {
return "
$uid";
}
+
+/**
+ * Run GNU Gettext
+ */
+function gettext_rocks($lang = 'it_IT', $domain = 'fuel.reyboz.it', $folder = 'l10n', $encoding = 'UTF-8') {
+ putenv("LANG=$lang.$encoding");
+ setlocale(LC_MESSAGES, "$lang.$encoding");
+ bindtextdomain($domain, $folder);
+ textdomain($domain);
+ bind_textdomain_codeset($domain, $encoding);
+}
diff --git a/l10n/it.reyboz.fuel.pot b/l10n/en_US.UTF-8/LC_MESSAGES/fuel.reyboz.it.po
similarity index 60%
copy from l10n/it.reyboz.fuel.pot
copy to l10n/en_US.UTF-8/LC_MESSAGES/fuel.reyboz.it.po
index d1ef9ea..13e390e 100644
--- a/l10n/it.reyboz.fuel.pot
+++ b/l10n/en_US.UTF-8/LC_MESSAGES/fuel.reyboz.it.po
@@ -1,254 +1,261 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2015 Valerio Bozzolan
# This file is distributed under the same license as the fuel.reyboz.it package.
-# FIRST AUTHOR
, YEAR.
+# Cesare de Cal , 2015.
#
-#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: it.reyboz.fuel\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-18 00:30+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
-"Language: \n"
+"POT-Creation-Date: 2015-11-18 22:06+0100\n"
+"PO-Revision-Date: 2015-11-18 07:22+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.6\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: about.php:9
msgid "Il Team «Il Cloud non esiste»"
-msgstr ""
+msgstr "“Cloud storage doesn’t exist” team"
#: about.php:10
msgid ""
"«Il Cloud non esiste» è il team che in 24 ore ha realizzato il progetto "
"vincitore dell'Hackaton di Facile.it 2015 presentando un comparatore di "
"prezzi dei carburanti."
msgstr ""
+"“Cloud storage doesn’t exist” is the team that in 24 hours has developed the "
+"winning project of the Facile.it 2015 Hackathon, presenting a fuel price "
+"comparator."
#: about.php:15 about.php:24
#, php-format
msgid "Articolo su %s"
-msgstr ""
+msgstr "Article on %s"
#: about.php:16 about.php:25
#, php-format
msgid "Leggi l'articolo su %s"
-msgstr ""
+msgstr "Read the article on %s"
#: about.php:41
msgid "Offensive Security Entusiast"
-msgstr ""
+msgstr "Offensive Security Entusiast"
#: about.php:57
msgid "Junior Hackathon hacker"
-msgstr ""
+msgstr "Junior Hackathon hacker"
#: about.php:58 about.php:75
msgid "Smartphone & web developer."
-msgstr ""
+msgstr "Smartphone & web developer."
#: about.php:74
msgid "Very Junior Hackathon hacker"
-msgstr ""
+msgstr "Very Junior Hackathon hacker"
#: about.php:91
msgid "Developer - DBA & Marketing Specialist"
-msgstr ""
+msgstr "Developer - DBA & Marketing Specialist"
#: about.php:92
msgid ""
"Sviluppo dell'importatore-bridge in PHP, MySQL fra i dati dello Sviluppo "
"Economico. Presentatore del progetto."
msgstr ""
+"Developed the PHP bridge, MySQL using the data supplied by Economic "
+"Development. Presenter of the project"
#: about.php:108
msgid "Tactical Banana"
-msgstr ""
+msgstr "Tactical Banana"
#: about.php:109
msgid "«Valerio per favore scrivi qui qualcosa di divertente». -Fatto-"
-msgstr ""
+msgstr "«Valerio please write down something funny». -Done-"
#: about.php:125
msgid "No-sleep Tech Orchestrator"
-msgstr ""
+msgstr "No-sleep Tech Orchestrator"
#: about.php:126
msgid "Sviluppo del frontend in PHP, MySQL e JavaScript."
-msgstr ""
+msgstr "Developed front-end in PHP, MySQL and JavaScript"
#: about.php:136
msgid "Tecnologie utilizzate"
-msgstr ""
+msgstr "Technologies"
#: about.php:140
msgid "Nome tecnologia"
-msgstr ""
+msgstr "Technology name"
#: about.php:141
msgid "Ruolo"
-msgstr ""
+msgstr "Team role"
#: about.php:142
msgid "Licenza di software libero"
-msgstr ""
+msgstr "Free software license"
#: about.php:148
msgid "Server web"
-msgstr ""
+msgstr "Server web"
#: about.php:153
msgid "Framework casereccio in PHP"
-msgstr ""
+msgstr "Homemade framework in PHP"
#: about.php:158
msgid "Ambiente server GNU/Linux"
-msgstr ""
+msgstr "GNU/Linux server environment"
#: about.php:163
msgid ""
"Libreria JavaScript per l'attraversamento, manipolazione e animazioni del DOM"
-msgstr ""
+msgstr "JavaScript library for manipulating and animating DOM"
#: about.php:168
msgid "Libreria JavaScript per mappe interattive"
-msgstr ""
+msgstr "JavaScript framework for interactive maps"
#: about.php:173
msgid "Framework responsivo ispirato al Material Design"
-msgstr ""
+msgstr "Responsive framework inspired by Material Design"
#: about.php:178
msgid "Set di icone Material Design"
-msgstr ""
+msgstr "Material Design icon set"
#: about.php:188
msgid ""
"Prezzi praticati e anagrafica degli impianti di carburante dal Ministero "
"dello Sviluppo Economico italiano."
msgstr ""
#: about.php:189
msgid "Carburanti - Prezzi praticati e anagrafica degli impianti"
-msgstr ""
+msgstr "Fuels - prices and details info about fuel stations"
#: about.php:193
msgid "Mappa collaborativa globale"
-msgstr ""
+msgstr "Collaborative global map"
#: about.php:198
msgid "Logo e favicon"
-msgstr ""
+msgstr "Logo and favicon"
#: about.php:199
msgid "Pubblico dominio"
-msgstr ""
+msgstr "Public domain"
#: about.php:203
msgid "Pre-processore di ipertesti"
-msgstr ""
+msgstr "Pre-processor of hypertexts"
#: about.php:204
msgid "Licenza PHP"
-msgstr ""
+msgstr "PHP licence"
#: about.php:208
msgid ""
"Software di presentazione HTML utilizzato per presentare il progetto "
"all'hackaton"
msgstr ""
+"Software for HTML presentations, used to present the project at the hackathon"
#: about.php:209
msgid "Licenza Reveal.JS"
-msgstr ""
+msgstr "Reveal.JS license"
#: about.php:215
msgid "Torna alla mappa"
-msgstr ""
+msgstr "Back to the map"
#: about.php:215
#, php-format
msgid "Torna a %s"
-msgstr ""
+msgstr "Back to %s"
#: index.php:48
#, php-format
msgid "Confronta velocemente i prezzi fra %s stazioni di rifornimento."
-msgstr ""
+msgstr "Quickly compare fuel prices between %s stations."
#: index.php:79
msgid "La tua segnalazione è preziosa. Per ora però sara ignorata <_<"
-msgstr ""
+msgstr "Your report is important to us. "
#: index.php:80
msgid "Aggiunta ai preferiti... Se funzionassero <_<"
-msgstr ""
+msgstr "Added to favorites. "
#: index.php:81
msgid "Geolocalizzazione fallita"
-msgstr ""
+msgstr "I couldn’t locate yourself"
#: index.php:82
msgid "Trova la tua zona, zomma!"
-msgstr ""
+msgstr "Find your area, zoom in!"
#: index.php:83
msgid "Vedo molte stazioni. Fai zoom per scoprirle"
-msgstr ""
+msgstr "I see many stations in this area. Zoom in"
#: index.php:84
msgid "Nessuna pompa di benzina in questa zona"
-msgstr ""
+msgstr "No fuel station found in this area."
#: index.php:85
msgid "Fai zoom! Qui ci sono {n} stazioni"
-msgstr ""
+msgstr "Zoom in! There are {n} stations"
#: index.php:86
msgid "Litri ogni {euro} € per {station}"
-msgstr ""
+msgstr "{euro}/liters per {station}"
#: index.php:87
msgid "Preferiti"
-msgstr ""
+msgstr "Favorites"
#: index.php:88
msgid "Segnala errore"
-msgstr ""
+msgstr "Report error"
#: index.php:89
msgid "Nessun indirizzo trovato. Riprova con parole più semplici."
-msgstr ""
+msgstr "No address found. Try with simpler words."
-#: load-post.php:22
+#: load-post.php:49
msgid "Compara carburanti"
-msgstr ""
+msgstr "Compare fuel prices"
-#: load-post.php:23
+#: load-post.php:50
msgid "Confronta i prezzi dei carburanti"
-msgstr ""
+msgstr "Compare fuels prices"
-#: load-post.php:83
+#: load-post.php:106
msgid "La mappa"
-msgstr ""
+msgstr "The map"
-#: load-post.php:88
+#: load-post.php:111
msgid "Informazioni sulla piattaforma"
-msgstr ""
+msgstr "Platform information"
#: includes/functions.php:40
msgid "Entra in contatto"
-msgstr ""
+msgstr "Get in touch"
#: includes/functions.php:40
#, php-format
msgid "Mettiti in contatto con %s"
-msgstr ""
+msgstr "Get in touch with %s"
#: includes/functions.php:44
#, php-format
msgid "Informazioni legali su %s"
-msgstr ""
+msgstr "Legal information on %s"
diff --git a/l10n/it.reyboz.fuel.pot b/l10n/fuel.reyboz.it.pot
similarity index 94%
rename from l10n/it.reyboz.fuel.pot
rename to l10n/fuel.reyboz.it.pot
index d1ef9ea..4c8b81f 100644
--- a/l10n/it.reyboz.fuel.pot
+++ b/l10n/fuel.reyboz.it.pot
@@ -1,254 +1,254 @@
# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2015 Valerio Bozzolan
-# This file is distributed under the same license as the fuel.reyboz.it package.
+# Copyright (C) YEAR Valerio Bozzolan
+# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR , YEAR.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: it.reyboz.fuel\n"
+"Project-Id-Version: fuel.reyboz.it\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-11-18 00:30+0100\n"
+"POT-Creation-Date: 2015-11-18 22:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: about.php:9
msgid "Il Team «Il Cloud non esiste»"
msgstr ""
#: about.php:10
msgid ""
"«Il Cloud non esiste» è il team che in 24 ore ha realizzato il progetto "
"vincitore dell'Hackaton di Facile.it 2015 presentando un comparatore di "
"prezzi dei carburanti."
msgstr ""
#: about.php:15 about.php:24
#, php-format
msgid "Articolo su %s"
msgstr ""
#: about.php:16 about.php:25
#, php-format
msgid "Leggi l'articolo su %s"
msgstr ""
#: about.php:41
msgid "Offensive Security Entusiast"
msgstr ""
#: about.php:57
msgid "Junior Hackathon hacker"
msgstr ""
#: about.php:58 about.php:75
msgid "Smartphone & web developer."
msgstr ""
#: about.php:74
msgid "Very Junior Hackathon hacker"
msgstr ""
#: about.php:91
msgid "Developer - DBA & Marketing Specialist"
msgstr ""
#: about.php:92
msgid ""
"Sviluppo dell'importatore-bridge in PHP, MySQL fra i dati dello Sviluppo "
"Economico. Presentatore del progetto."
msgstr ""
#: about.php:108
msgid "Tactical Banana"
msgstr ""
#: about.php:109
msgid "«Valerio per favore scrivi qui qualcosa di divertente». -Fatto-"
msgstr ""
#: about.php:125
msgid "No-sleep Tech Orchestrator"
msgstr ""
#: about.php:126
msgid "Sviluppo del frontend in PHP, MySQL e JavaScript."
msgstr ""
#: about.php:136
msgid "Tecnologie utilizzate"
msgstr ""
#: about.php:140
msgid "Nome tecnologia"
msgstr ""
#: about.php:141
msgid "Ruolo"
msgstr ""
#: about.php:142
msgid "Licenza di software libero"
msgstr ""
#: about.php:148
msgid "Server web"
msgstr ""
#: about.php:153
msgid "Framework casereccio in PHP"
msgstr ""
#: about.php:158
msgid "Ambiente server GNU/Linux"
msgstr ""
#: about.php:163
msgid ""
"Libreria JavaScript per l'attraversamento, manipolazione e animazioni del DOM"
msgstr ""
#: about.php:168
msgid "Libreria JavaScript per mappe interattive"
msgstr ""
#: about.php:173
msgid "Framework responsivo ispirato al Material Design"
msgstr ""
#: about.php:178
msgid "Set di icone Material Design"
msgstr ""
#: about.php:188
msgid ""
"Prezzi praticati e anagrafica degli impianti di carburante dal Ministero "
"dello Sviluppo Economico italiano."
msgstr ""
#: about.php:189
msgid "Carburanti - Prezzi praticati e anagrafica degli impianti"
msgstr ""
#: about.php:193
msgid "Mappa collaborativa globale"
msgstr ""
#: about.php:198
msgid "Logo e favicon"
msgstr ""
#: about.php:199
msgid "Pubblico dominio"
msgstr ""
#: about.php:203
msgid "Pre-processore di ipertesti"
msgstr ""
#: about.php:204
msgid "Licenza PHP"
msgstr ""
#: about.php:208
msgid ""
"Software di presentazione HTML utilizzato per presentare il progetto "
"all'hackaton"
msgstr ""
#: about.php:209
msgid "Licenza Reveal.JS"
msgstr ""
#: about.php:215
msgid "Torna alla mappa"
msgstr ""
#: about.php:215
#, php-format
msgid "Torna a %s"
msgstr ""
#: index.php:48
#, php-format
msgid "Confronta velocemente i prezzi fra %s stazioni di rifornimento."
msgstr ""
#: index.php:79
msgid "La tua segnalazione è preziosa. Per ora però sara ignorata <_<"
msgstr ""
#: index.php:80
msgid "Aggiunta ai preferiti... Se funzionassero <_<"
msgstr ""
#: index.php:81
msgid "Geolocalizzazione fallita"
msgstr ""
#: index.php:82
msgid "Trova la tua zona, zomma!"
msgstr ""
#: index.php:83
msgid "Vedo molte stazioni. Fai zoom per scoprirle"
msgstr ""
#: index.php:84
msgid "Nessuna pompa di benzina in questa zona"
msgstr ""
#: index.php:85
msgid "Fai zoom! Qui ci sono {n} stazioni"
msgstr ""
#: index.php:86
msgid "Litri ogni {euro} € per {station}"
msgstr ""
#: index.php:87
msgid "Preferiti"
msgstr ""
#: index.php:88
msgid "Segnala errore"
msgstr ""
#: index.php:89
msgid "Nessun indirizzo trovato. Riprova con parole più semplici."
msgstr ""
-#: load-post.php:22
+#: load-post.php:49
msgid "Compara carburanti"
msgstr ""
-#: load-post.php:23
+#: load-post.php:50
msgid "Confronta i prezzi dei carburanti"
msgstr ""
-#: load-post.php:83
+#: load-post.php:106
msgid "La mappa"
msgstr ""
-#: load-post.php:88
+#: load-post.php:111
msgid "Informazioni sulla piattaforma"
msgstr ""
#: includes/functions.php:40
msgid "Entra in contatto"
msgstr ""
#: includes/functions.php:40
#, php-format
msgid "Mettiti in contatto con %s"
msgstr ""
#: includes/functions.php:44
#, php-format
msgid "Informazioni legali su %s"
msgstr ""
diff --git a/load-post.php b/load-post.php
index 1250aa7..104b4f2 100755
--- a/load-post.php
+++ b/load-post.php
@@ -1,94 +1,113 @@
.
*/
// Customizing Boz PHP - Another PHP framework
-define('SITE_NAME', _("Compara carburanti") );
-define('SITE_DESCRIPTION', _("Confronta i prezzi dei carburanti") );
define('INCLUDES', 'includes');
define('MATERIALIZE', INCLUDES . _ . 'materialize');
define('JQUERY', INCLUDES . _ . 'jquery');
define('LEAFLET', INCLUDES . _ . 'leaflet');
+// Load functions
+require ABSPATH . _ . INCLUDES . '/functions.php';
+require ABSPATH . _ . INCLUDES . '/header.php';
+require ABSPATH . _ . INCLUDES . '/footer.php';
+
+// Choose language
+switch( $lang = @ $_GET['l'] ) {
+ case 'en_US':
+ case 'it_IT':
+ gettext_rocks($lang);
+ break;
+ default:
+ // Choose from browser settings
+ switch( substr(@$_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) ) {
+ case 'it':
+ gettext_rocks('it_IT');
+ break;
+ default:
+ gettext_rocks('en_US');
+ }
+}
+
+define('SITE_NAME', _("Compara carburanti") );
+define('SITE_DESCRIPTION', _("Confronta i prezzi dei carburanti") );
+
register_js(
'jquery',
URL . _ . JQUERY . '/jquery-2.1.4.min.js'
);
register_js(
'jquery.ui',
URL . _ . INCLUDES . '/jquery-ui/jquery-ui.min.js'
);
register_js(
'materialize',
URL . _ . MATERIALIZE . '/js/materialize.min.js'
);
register_js(
'leaflet',
URL . _ . LEAFLET . '/leaflet.js'
);
register_js(
'leaflet.bouncemarker',
URL . _ . INCLUDES . '/leaflet.bouncemarker/bouncemarker.js'
);
register_js(
'my-facile',
URL . _ . INCLUDES . '/facile.js'
);
register_css(
'materialize',
URL . _ . MATERIALIZE . '/css/materialize.min.css'
);
register_css(
'leaflet',
URL . _ . LEAFLET . '/leaflet.css'
);
register_css(
'my-facile',
URL . _ . INCLUDES . '/facile.css'
);
register_css(
'materialize.icons',
'https://fonts.googleapis.com/icon?family=Material+Icons'
);
add_menu_entries([
new MenuEntry(
'map',
URL,
_("La mappa")
),
new MenuEntry(
'about',
URL . '/about.php',
_("Informazioni sulla piattaforma")
)
]);
-
-require ABSPATH . _ . INCLUDES . _ . '/header.php';
-require ABSPATH . _ . INCLUDES . _ . '/footer.php';
-require ABSPATH . _ . INCLUDES . _ . '/functions.php';