-
Notifications
You must be signed in to change notification settings - Fork 16
Languages
To simplify the process of adding new languages all language specific files were grouped together and placed in one folder. Here are the default languages supplied with Peppy Player:
- English/USA
- German
- French
- Russian
- Italian
- Spanish
- Dutch
- Czech
- Polish
The following image shows the languages folder structure:
The file languages.txt serves as the registry for all languages. Each language specific folder has the following files and sub-folders:
The process of adding new language involves the following steps:
- Add entry to the languages.txt file.
- Create folder for language specific files.
- Add flag.png image which will serve as the label for the language.
- Prepare file labels.properties. This file consists of all UI labels.
- Prepare file voice-commands.properties which keeps all voice commands for voice assistant.
- Provide TTF font file for your language if the default font FiraSans.ttf doesn't support your language.
- Create web radio playlists.
Let's consider the process of adding new language using Japanese as the example.
If some of the default languages are not used they can be disabled. After that the language will be removed from the Language menu. Here is example of disabling Russian in file languages.txt:
#[Russian]
#English-USA = Английский-США
#German = Немецкий
#French = Французский
#Russian = Русский
The entry for Japanese language should look like this:
[Japanese]
English-USA = 英語
German = ドイツ人
French = フランス語
Russian = ロシア
Japanese = 日本語
Also Japanese should be added to all other sections in file language.txt. For example:
[English-USA]
English-USA = English-USA
German = German
French = French
Russian = Russian
Japanese = Japanese
After disabling Russian and enabling Japanese (and completing all next steps) the Language menu will look like this:
This folder should have the same name as it was defined in file languages.txt. The following image shows new folder for Japanese:
This image will represent the language in the languages menu. You can create your own image or borrow it from the Internet. The image's file format should be PNG. The size can be arbitrary as it will be resized to fit to the languages menu.
The best way to prepare this file is to copy the existing file for one of the default languages and translate it to your language. Here is the example showing several labels translated to Japanese:
home = ホームメニュー
radio = 無線
screensaver = スクリーンセーバー
language = 言語
about = 約
audio-files = オーディオファイル
stream = ストリーム
audiobooks = オーディオブック
cd-player = CDプレーヤー
...
After translating labels in file labels.properties (and completing the rest steps) UI labels will look like in the following images:
This file contains voice commands. If you are not planning to use voice assistant there is no need to translate commands in this file. Just copy one of the existing files and keep it as is.
The default font FiraSans.ttf has Latin and Cyrillic alphabets. Therefore it can support all four default languages. It doesn't support Japanese characters. There are many web sites in the Internet which provide free fonts for any language. I found free font osaka.unicode.ttf which supports Japanese characters. It should be placed in the language folder. Only fonts in TTF format are supported.
Web Radio playlists should be placed in folder radio-stations. The next sub-folder defines the top level menu for radio stations. The default name of that folder is Genre and it defines radio genres/folders. The following image shows the folder structure:
Each folder should have two images: folder.png and folder-on.png. Here is example of those images for the genre 'Children':
And next image shows how these images will look like in UI on Radio player screen and Genre screen:
File stations.m3u keeps the links to the radio stations for the genre defined by the folder. Here is example of two entries from that file for genre Children and language English-USA:
#Kids Public Radio. Lullaby
http://kidspublicradio2.got.net:8000/lullaby
#Kids Public Radio. Pipsqueaks
http://kidspublicradio2.got.net:8000/pipsqueaks
The first line in the station definition will serve as the station name in UI. Also the same string serves as the image name for the station logo. So for the two stations defined in the example above there are two image files:
Kids Public Radio. Lullaby.png
Kids Public Radio. Pipsqueaks.png
The order of stations in the file defines the order of stations in the menu.
Peppy player is using web site librivox.org for listening audiobooks. The audiobooks for the following languages are currently available on that web site:
- Bulgarian
- Chinese
- Danish
- Dutch
- English
- Esperanto
- Finnish
- French
- German
- Greek
- Hebrew
- Hungarian
- Italian
- Japanese
- Javanese
- Latin
- Latvian
- Polish
- Portuguese
- Russian
- Spanish
- Swedish
- Tagalog
- Tamil
- Urdu
If the language which you are adding is not in this list then Audiobooks menu option will be disabled in Home menu and this functionality will not be available. Japanese is in the list and Audiobooks player for Japanese looks like this:
- Peppy Players
- Peppy Home
- Hardware
- Audio Players
- Software
- Installation Guide
- Updating Guide
- Peppy Configuration
- Languages
- Scripts
- Voice Assistant
-
Peppy Player UI
- About
- Home Screen
- Radio Player
- Radio Groups
- Radio Favorites
- Radio Browser
- File Browser
- File Menu
- Quick Configuration
- File Player
- Audiobooks Player
- Audiobooks Browser
- Stream
- Podcasts Player
- Podcasts Browser
- AirPlay
- Spotify Connect
- Bluetooth Sink
- Jukebox
- Archive
- Equalizer
- Timer
- Language
- Network
- Headless Mode
- Resolution
- Recursive Playback
- Playback Order
- Information
- Background
- Icons
- Fonts
- Player Screen
- Image Viewer
- Switch
- Collection
- Catalog
- YA Streams
- Web UI
- Screensavers
- Woodware
- Sketches