Run your site
Translate GuestLens
GuestLens ships in English. Every piece of text on the site comes from a language file, so you can translate the whole site without touching the page templates: the guest pages, the slideshow, the host and admin screens, the emails, and the printed cards.
Add a language
-
Copy
lang/en.jsonto a new file in the same folder. Name it after the language code, for examplelang/de.jsonfor German,lang/es.jsonfor Spanish, orlang/pt_BR.jsonfor Brazilian Portuguese. - Open the new file in a text editor. Each line has the English text on the left and the text to show on the right. Translate the right side only. Leave the left side exactly as it is, because GuestLens uses it to find the line.
- Upload the file to the
langfolder on your server. - In the admin, open Settings, choose the language under Language, and press Save.
A line you have not translated yet shows in English, so you can translate a little at a time.
{
"Your uploads": "Deine Uploads",
"Shared by :name": "Geteilt von :name",
":count file|:count files": ":count Datei|:count Dateien"
}
Rules for the text
-
Keep the words that start with a colon, such as
:name,:count, or:date. GuestLens puts a value there. You can move them within the sentence. -
Lines with a
|are plurals. The part before the bar is used for one, the part after it for more than one. Translate both parts. - Save the file as UTF-8, and keep it valid JSON: a comma after every line except the last.
Standard form errors
A few standard messages, such as "The email field is required.", come from the four files in
lang/en/. To translate them, copy that folder to a new
folder with the same language code, for example lang/de/, and translate the text in
each file. Ready-made translations of these files for many languages are published by the
open-source Laravel Lang project.
What changes by itself
- Month and day names, and times such as "3 minutes ago", follow the language you choose.
- The text that the browser writes, such as upload progress and the slideshow controls, comes from the same file.
- The names of events, plans, and hosts are not translated. They are shown as they were typed.
Change the English wording
To change a word in English, do not edit lang/en.json, because an update replaces
it. Copy it to lang/en_US.json, change the right side of the lines you want, and
choose that language in Settings.
lang/en.json. Your own file keeps working, and the new lines show in English until
you add them. The Changelog says when text was added.
Right-to-left languages, such as Arabic and Hebrew, are not tested. The text translates, but the layout still reads left to right.