Problem/Motivation
When using Olark module on multilingual site with multiple languages enabled it shows default values for chat elements in english for all languages enabled on the site. There is no option to translate the text that is shown in chat box.
Optional: Provide an easy way to change the text shown in chat box (placeholders, title, etc.).
Proposed resolution
Use locale options provided by Olark to modify strings used for chat box. Add a variable to store all configuration and make variable multilingual using Variable translation.
Remaining tasks
Port changes to Drupal 8.
User interface changes
Added a new text area to admin settings form that stores extra settings.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | multilingual_support-2797177-10.patch | 2.55 KB | apugacescu |
| #7 | multilingual_support-2797177-7.patch | 2.48 KB | apugacescu |
| #2 | multilingual_support-2797177-2.patch | 7.9 KB | apugacescu |
| Screenshot from 2016-09-08 16-23-04.png | 111.46 KB | apugacescu |
Comments
Comment #2
apugacescu commentedComment #3
apugacescu commentedComment #4
apugacescu commentedComment #5
joelpittetThank you for the patch.
You shouldn't be using t() on hook_menu() items from the docs: https://www.drupal.org/node/323101
The JS locale in the docs would need to keep tabs with things they change upstream so I'm not sure if we should do that...
Any reason you don't just chuck that code in the "Olark code" box?
Comment #6
boyan.borisov commentedUseful patch indeed.
Thank you, @SurfinSpirit.
I guess the reason to have the new olark_extra_settings is to keep the JS that should be localized separatly from that JS which shouldn't...but I also think that is a kind of overhead. lets keep everything in olark_settings and to make it i18n variable. I think will make the settings less confusing too for the people which already use the module.
Comment #7
apugacescu commentedDid proposed modifications, attaching new patch.
The idea behind a separate variable is to keep the code provided by 'Olark installation' vanilla, but I agree having two variables can be confusing.
Comment #8
apugacescu commentedComment #9
joelpittetSorry for the delay, this looks good. Could we move the variable module stuff into
olark.variable.inc? That way it's nice and separated and really only loaded if the variable module is installed.Comment #10
apugacescu commentedMoved variable related functionality to a separate file based on https://www.drupal.org/project/variable
@joelpittet thanks for noticing this.
Comment #12
joelpittetThanks @SurfinSpirit, I've committed this to the 7.x-1.x-dev branch.