Tuesday, August 26, 2014

PirateBox for Android - Android Wear

Starting with version 0.53 PirateBox for Android supports Android Wear notifications for uploads and shout messages.

Android Wear support is disabled by default but can be enabled inside the PirateBox preferences. There is a new Android Wear section which currently only has one Wear Notification check-box preference.
As soon as this option is ticked upload and shout notifications will be sent to a connect Wear device.

Android Wear Preference

Whenever a new upload or shout has been processed and sent to the Wear device a notification is displayed on the Android device (the phone) to indicate that new notifications have been transferred to the Wear device. If that notification gets dismissed, all notifications on the smart-watch will also be deleted.

Wear Notification on Phone

On the smart-watch notifications are summarized and presented in chronological order (newer first). The following image describes the flow on the Wear device.

Flow on Wear Device

After the messages have been expanded options are available to open the PirateBox app on the phone and in the case of a file upload to open that file on your phone for display.

Thursday, August 7, 2014

PirateBox for Android - I18N

The latest PirateBox for Android version 0.5.2 adds i18n support to the web interface. It is now possible to change the language of the web interface independent of the phone's langue settings.
This post will show how to add your own translations in a few easy steps ...

The language files are stored inside the piratebox/html/i18n* folder. The file names have the following format: i18n_ISO.properties
The ISO part specified the ISO 639-1 code which defines the language. Here is a list of available ISO language codes: Language Codes according to ISO 639-1

To add your own translation copy the English translation i18n_en.properties file and rename it to your desired language. To take French as an example, the file would be named i18n_fr.properties.

It is important to note that the file encoding has to be ISO-8859-1, otherwise you might have issues displaying the characters correctly inside the web interface.

Now you can start editing the file. The file contains key value pairs separated by an equals (=) sign. All you have to do is to translate the right hand side of the euqation.
Here is an example, the original in English on the left and the French translation on the right:
button.thanks=Thanks                                button.thanks=Merci

If all lines have been translated, copy the  new file to the piratebox/html/i18n folder and you are almost done.

To select the new language simply go to the preferences of the PirateBox app and select Web Interface Language. If everything worked well the language should be available for selection.



After a restart of the server the web interface should show the new translation.
Besides English the web interface is already translation into German. If you have made your own translation, you can send it to me** and I'll include it in the next release***.

Have fun and I hope everything is working as it should ...


Base directory: /data/data/de.fun2code.android.piratebox/files/
** Mail: jochen[at]fun2code.de
*** If there are multiple for the same language, I'll pick one...