mach Posted March 13, 2014 Share Posted March 13, 2014 Hi, as an example, if I have set up a module with the following code for the config fields: public static function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); $field = wire('modules')->get('InputfieldText'); $field->name = 'headline_default'; $field->label = "Please enter the headline:"; $inputfields->add($field); return $inputfields; } Is there a way for the input fields to support multiple languages, similar to TextLanguage fields? The only alternative that I can think of now is to code in multiple fields for each language: public static function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); $field = wire('modules')->get('InputfieldText'); $field->name = 'headline_default'; $field->label = "Please enter the promo headline:"; $inputfields->add($field); $field = wire('modules')->get('InputfieldText'); $field->name = 'headline_french'; $field->label = "Please enter the promo headline (French):"; $inputfields->add($field); return $inputfields; } but that's not dynamic and would become a hassle if I add multiple modules and/or languages in the future. Link to comment Share on other sites More sharing options...
Soma Posted March 13, 2014 Share Posted March 13, 2014 Still nope. There was same question some time ago. Module config is stored as json and you use Inputfields not Fieldtype. There's the pager module I think where Ryan has text per language . Maybe worth a look. Sorry I think its in LanguageSupportPageNames module. 1 Link to comment Share on other sites More sharing options...
bfncs Posted April 15, 2014 Share Posted April 15, 2014 Soma, you're right, there's something to be found in the source of LanguageSupportPageNames module: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/LanguageSupport/LanguageSupportPageNames.module#L781 Actually, Ryan creates a new InputfieldName for each language there, no real Multilanguage Field. Shouldn't this be possible as well? Edit: I just had a look at the relevant section in ProcessModule module and the way it is handled there sadly doesn't work together with "real" multilanguage fields. Link to comment Share on other sites More sharing options...
Can Posted December 21, 2015 Share Posted December 21, 2015 Would be amazing to get multilanguage ckeditor in form api Or am I mixing things up and it's only not supported for module configs? If so please let me know how to use multilanguage ckeditor with form api, I got a little Newsletter ProcessModule and right now I use 2 textareas side by side, would be neat two have 'em like on a page edit page Link to comment Share on other sites More sharing options...
adrian Posted October 31, 2016 Share Posted October 31, 2016 Just came across the need for this, so thought I'd submit a feature request: https://github.com/processwire/processwire-requests/issues/46 Link to comment Share on other sites More sharing options...
Can Posted October 31, 2016 Share Posted October 31, 2016 https://github.com/CanRau/MarkupCookieConsent/ is already doing this and Ryan fixed some missing parts some month ago.. 6 Link to comment Share on other sites More sharing options...
adrian Posted October 31, 2016 Share Posted October 31, 2016 3 minutes ago, Can said: https://github.com/CanRau/MarkupCookieConsent/ is already doing this and Ryan fixed some missing parts some month ago.. Thanks @Can - just looked through your module and have it working for my module already. Thanks so much for pointing me to this! 1 Link to comment Share on other sites More sharing options...
Can Posted October 31, 2016 Share Posted October 31, 2016 that was quick! great I could help 1 Link to comment Share on other sites More sharing options...
adrian Posted October 31, 2016 Share Posted October 31, 2016 Just now, Can said: that was quick! That's because I stole the relevant bits from your code 1 Link to comment Share on other sites More sharing options...
Can Posted October 31, 2016 Share Posted October 31, 2016 okay so you're that kind of guy..good to know.. haha.. 1 Link to comment Share on other sites More sharing options...
tomaskostadinov Posted July 2, 2020 Share Posted July 2, 2020 For anyone finding this thread after a google search: The solution with ProcessWire 3x is $field = wire('modules')->get('InputfieldText'); $field->name = 'headline_default'; $field->label = "Please enter the promo headline:"; $field->useLanguages = true; // add this line $inputfields->add($field); 1 Link to comment Share on other sites More sharing options...
Matzn Posted March 17, 2021 Share Posted March 17, 2021 @tomaskostadinov and how do you access the fields by language? I found only a solution by suffix. Or there is another solution? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now