Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Custom language strings in advanced theme? Need for theme settings!

+3 votes
360 views
asked Feb 21, 2014 in Themes by q2apro

I am working on a new theme. The problem I face now: I put buttons in the interface with custom strings. For instance, there is a button "ask now, it's free" which could also be German "frag jetzt, kostenlos" or in another language. It's up to the user.

As far as I see there is no method to setup custom language strings with the theme installation. In other words, I cannot offer the user an input field directly where he can insert the string for the button.

How have you solved this? How would you solve it?

I get the feeling that there is a need for theme settings / options like we have it with the plugins!

Cheeers,
Kai

Q2A version: 1.6.3
commented Apr 7, 2016 by q2apro
Push to top... This question is still of interest and I do not have a solution yet.

1 Answer

+1 vote
answered Apr 25, 2016 by Scott
Theme options is something I've been considering for a while, Jatin had a plugin for the SnowFlat theme where you could change the colours, which would work better as integrated theme options.

Having said that, adding a separate unique button is more of a plugin concern than a theming concern. You could make a widget or layer plugin that adds the button, and utilises plugin translations. Or a simple module with only the admin_options function where you set the language strings in options, and use those in the theme class.
commented Apr 26, 2016 by q2apro
Then we need to force each user to install a "theme plugin" additionally to the "theme". Why not make it easy first hand?
...