Translate PHPPoll into your language
Translate the PHPPoll admin panel and poll texts into any language by copying one language file. Step-by-step guide with placeholders, fallback and tips.
All texts that PHPPoll shows – in the admin panel, on the voting forms, in error messages and emails – are stored in one language file. Translating the script means translating that file. No code changes are needed.
Steps
- Open the folder
lang/and make a copy ofen.php. Name it with your language code, for examplede.php,fr.php,es.phporbg.php. - Open the new file in a text editor that saves in UTF-8 (for example VS Code or Notepad++).
- Change
'_language_name' => 'English'to the name of your language, for example'Deutsch'. - Translate the text on the right side of each
=>. Do not change the keys on the left. - Upload the file and choose the language in Settings → General → Language. Save.
Example
'vote' => 'Abstimmen', 'thank_you' => 'Danke für Ihre Stimme!', 'already_voted' => 'Sie haben bereits abgestimmt.',
Placeholders
Some texts contain %s or %d. They are replaced by names or numbers and must stay in the translation, for example 'n_votes' => '%s Stimmen'. If you need a literal percent sign in such texts, write %%.
Apostrophes and quotes
Texts are wrapped in single quotes. Write a single quote inside a text as \', or use typographic quotes.
What if some texts are missing?
Missing keys are taken from the English file automatically, so you can translate step by step and your site always works.
Where texts appear
| Part of the file | Where the text is used |
|---|---|
| Public poll | Buttons, messages, hints and errors seen by voters. |
| Standalone poll website | Headings and share links. |
| Emails | Notification and test emails. |
| Login & setup, menu, dashboard… | The admin panel. |
Use the same file to adjust English wording to your taste: change "Vote" to "Send my answer" or "Thank you for voting!" to your own brand voice.
The language also affects the CSV export headers. See Export poll votes to CSV.
Last updated