Recently Browsing 0 members
No registered users viewing this page.
By Crowdland Technology
I'm having some issues with Greek as default language, because the page name is not created automatically when enter the title of a new page.
Any chance to add support for it?
I found this char mapping that might help on line 188
[EDIT]: A solution
This was easier than we thought, we managed to find a solution by looking at how the sanitizer of page names works.
This is how the URL looks with this solution:
For ProcessWire 3+ (what we tested) find Modules > Core > InputfieldPageName and under the “Character Replacements” Field you can add the mapping you would like.
The replacement is not in the Core yet, so adding it for reference. The mapping is adjusted and simplified, and it follows the official Transliteration found here: https://en.wikipedia.org/wiki/Romanization_of_Greek
Cheers to @PWaddict for also supplying an unofficial mapping and pointing us to the right direction
@ryan It would be great if this would be added to the Core sometime in the future and we can assist with further official mappings that are not present in this simplified version.
Elissavet from CrowdLand
Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:
This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
I still did not solve my problem about Hebrew letters. In fact, it is ok for Russian for example to have a transliteration of characters (one to one) but in languages like Hebrew, Arabic, it is better to slugify with phonetic like here :
use EasySlugger\Utf8Slugger; $slug = Utf8Slugger::slugify('日本語'); // slug = ri-ben-yu $slug = Utf8Slugger::slugify('العَرَبِيةُ'); // slug = alrbyt $slug = Utf8Slugger::slugify('עברית'); // slug = bryt So I am planning to insert https://github.com/javiereguiluz/EasySlugger
Should I create a module or just add a hook ?
I am a PW newbie.
Thanks for your help
This is not directly about language module but I think I can get information from you.
Can I add a vendor module to have all languages written automatically into name?
I used this vendor module which is good with any language (hebrew, arabic...). How could I add it, so admin interface can use it ?
I am using the translation function (either $this->_() or __()) within a module that responds to AJAX API calls - there isn't really a page that is being served.
When I supply a string with an apostrophe, e.g.,
__('Book \'em danno') It is formatted as
Book 'em danno
Is there some way to prevent output formatting when retrieving strings using the translation functions?