This is an update to an earlier post for the new Photo Station 5.0.
Original post: here
Most of the instructions are the same with very few exceptions.
Before you continue keep in mind that this procedure requires that you edit important configuration files. I give no guarantee this will work and won't mess up your DS configuration!!!
So here is my solution for adding Bulgarian but it can work for any other language. Here I assume you have a shared folder with write permissions called Shared.
Getting Language templates
1) log in as root to the disk-station using a SSH client such as putty.
2) copy the following files to a shared folder on your DS:
- /usr/syno/synoman/phpsrc/photo/language/enu.php
- /usr/syno/synoman/scripts/texts/enu/strings
The easiest way is to simply write the following:
- Code: Select all
cp /usr/syno/synoman/phpsrc/photo/language/enu.php /volume1/Shared/.
cp /usr/syno/synoman/scripts/texts/enu/strings /volume1/Shared/.
These files are the main language files used by Synology and can serve as a template for your translation. Of course you can pick up any of the other currently supported languages from those locations as a template. Work hard on good translations and once done you can share them with the world
I've done translations for PS 4.0 and will upload the 5.0 translation when I figure out a way to do it whcih does not invole my DS. Any suggestions? Dropbox may be?
Editing the system files
Once you have the translations you should do the following:
- Log in to the diskstation as root over SSH
- Now you have to tell the DS to switch to that new language. To do that you have to edit the synophoto_csPhotoMisc.php file found under /usr/syno/synoman/phpsrc/photo/include/photo. This is the main difference from the 4.0 version. The easiest is again to copy the file to a shared folder and edit from there. This is a file that you will have to overwrite so it is a good idea to back it up. Do the following:
- Code: Select all
cp /usr/syno/synoman/phpsrc/photo/include/photo/synophoto_csPhotoMisc.php /volume1/Shared/
cp /usr/syno/synoman/phpsrc/photo/include/photo/synophoto_csPhotoMisc.php /usr/syno/synoman/phpsrc/photo/include/photo/synophoto_csPhotoMisc.php.old
, where the second line backs you old file just in case (note it's actually one command on both 2nd and 3rd lines so copy all on one line!).
Open the file for editing in whatever editor you have from the Shared folder. In the file you will see a "switch"/"case" construct starting from about line number 790. In the case listing there are all the languages that the DS can currently switch between. Copy a complete segment that looks like this:- Code: Select all
case !strncasecmp($lang, "en-", 3):
$lang = 'enu';
break;
}
and insert it in the loop. Change the abbreviations to your language in the example with Bulgarian it looks like this:- Code: Select all
some other cases here...
case !strncasecmp($lang, "bg-", 3):
$lang = 'bul';
break;
some more cases here...
The "bg-" variable is the language of your country as defined for the HTML standard and reference can be found here. A quick and dirty way is to open any page in your language and view the source code (using Google Chrome this is under Settings (the little wrench)->Tools->View Source). Some of the first lines would feature a definition like this: lang="bg". The bg in the quote is the language code.
The $lang = 'bul' variable identifies the translated language file. So for example if you copied enu.php and translated it in Bulgarian a nice name to give would be bul.php so you enter bul in the code. - Now that the DS knows that the new language exists you have to enable it. Execute the following:
- Code: Select all
cp /etc.defaults/synoinfo.conf /volume1/Shared/
cp /etc.defaults/synoinfo.conf /etc/synoinfo.conf.old
, where again the second line is simply a back up. This is the main configuration file of the DS. It is quite dangerous to touch stuff here without experience so be careful. Open the file in a text editor and find the following line:- Code: Select all
supplang="enu,cht,chs,krn,ger,fre,ita,spn,jpn,dan,nor,sve,nld,rus,plk,ptb,ptg,hun,trk,csy"
, which lists all supported languages by default. It can be found under the # UI options (limitations) section. Add your language to the list so that it becomes something like:- Code: Select all
supplang="bul,enu,cht,chs,krn,ger,fre,ita,spn,jpn,dan,nor,sve,nld,rus,plk,ptb,ptg,hun,trk,csy"
The order doesn't matter... I think...
Installing the new language and modified configuration files
Now you are ready to install the new language. Perform the following commands:
- Code: Select all
cp /volume1/Shared/bul.php /usr/syno/synoman/phpsrc/photo/language/.
This copies the translated .php file.
- Code: Select all
mkdir /usr/syno/synoman/scripts/texts/bul
cp /volume1/Shared/strings /usr/syno/synoman/scripts/texts/bul/
This first makes a new folder for the Bulgarian translation of the script strings and then copies the translations there.
- Code: Select all
cp /volume1/Shared/synophoto_csPhotoMisc.php /usr/syno/synoman/phpsrc/photo/include/photo/.
cp /volume1/Shared/synoinfo.conf /etc/.
cp /volume1/Shared/synoinfo.conf /etc.defaults/.
This copies the two edited configuration files where they belong. I'm not sure if the copy to the etc.defaults is really needed. For me it worked without.
No reboot should be needed.
To view the Photo Station page in the new language you have to set your browser default language to it and the Photo Station server will automatically switch.
Each update adds/removes some stuff from the language strings and all these settings are cleared. I've been redoing this procedure after each update...
May be Synology could offer an easier way?
Good luck!
!!!!!!!!!!!!!!!!! DSM 4.0 UPDATE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
With the introduction of DSM4.0_2166_beta Synology have moved the PhotoStation and Blog services to an external application. The above procedure is still valid but the location of the PhotoStation root folder was moved to /volume1/@appstore/PhotoStation. The original English template enu.php and the language description file synophoto_csPhotoMisc.php can be found there. The strings and synoinfo.conf files are at the same locations. Few updated to the translations are also necessary but that's usually true with each release.
!!!!!!!!!!!!!!!!! DSM 4.0 UPDATE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

