Search the Community
Showing results for tags 'LanguageSupport'.
-
Hi Our simple code: <?php echo __("Welcome to our website"); ?> I have installed the following core modules: Language Support Language Support - Fields Language Support - Page Names Language Support - Tabs Translation export/import I added the translation text for both the default and Tamil languages for the sentence "Welcome to our website" in the admin interface. Please find the screenshots PW-dash1.png and PW-dash2.png However, we are facing an error when call this sentence in the following template file site/templates/test-lang.php. Error: Fatal error: Uncaught Error: Call to undefined function __() in E:\wamp\www\processwire-dev\site\templates\test-lang.php on line 3 ( ! ) Error: Call to undefined function __() in E:\wamp\www\processwire-dev\site\templates\test-lang.php on line 3 Please find the screenshot of PW-error.png Please suggest how to resolve this.
- 14 replies
-
- language
- languagesupport
-
(and 1 more)
Tagged with:
-
Hi community, I am using the "PageTable" Module (also called "ProFields: Page Table") and the built in "Language" Module (also called "Languages Support"). With the help of PageTable I was able to create several content elements which should usually be displayed in German(default language) and English. However some Content Elements should only be shown in German and NOT in English. Well sounds easy, right? Not so fast. I really love this CMS, but I have not found a solution for this problem yet. As you can see in the screenshots attached I tried to uncheck the "active" Checkbox for the english language to completely hide the content element for english users. However no matter what I do the german text shows on the english page. If I leave the "content-should-not-be-shown-in-english"(see Screenshot Number 2) blank and save the page, the page will inherit the german page url "content-element-with-simple-text-which-should-only-be-shown-in-german". My question therefore is: How can I hide a specific content-element for only one language? I´m using the latest processwire & module versions. The code which I use to render the content elements looks like this: //Info: contentelements is a field of type "ProFields: Page Table" <?php foreach ($page->contentelements as $element): echo($element->render()); endforeach; ?> filename: basic-page.php I would really appreciate your help since I haven´t found a solution after reading through quite a lot of forum posts. All the best, Dani
- 1 reply
-
- languagesupport
- pagetable
-
(and 1 more)
Tagged with:
-
hey there, i'm trying to change the C of my LanguageSupport.module, but i get this strange extra field right beneath it. the strange thing is: i never changed any permissions for any user. am i doing something wrong? thanks!
-
Hey there, I'm very new to Processwire but allready in love! So far my experience was great but I ran into an internal server Error (500) and my error logfile logged: Error: Exception: Unknown language (in P:\xampp\htdocs\xxx\wire\modules\LanguageSupport\Languages.php line 343) (I know XAMPP is not the best developing area but for simplicity reasons I like it...) The line 343 in my Languages.php(unchanged by me) is: if(!$language instanceof Language || !$language->id) throw new WireException("Unknown language"); in the function of public function setLanguage($language) { if(is_int($language)) { $language = $this->get($language); } else if(is_string($language)) { $language = $this->get($this->wire('sanitizer')->pageNameUTF8($language)); } if(!$language instanceof Language || !$language->id) throw new WireException("Unknown language"); $user = $this->wire('user'); $this->savedLanguage2 = null; if($user->language && $user->language->id) { if($language->id == $user->language->id) return false; // no change necessary $this->savedLanguage2 = $user->language; } $user->language = $language; return true; } I have no clue what the problem is and as far as I know when I closed the website the day before everything was working just fine. I copied the whole folder to "develop" further on my laptop. The next day I got the error mentioned above when requesting the site. (On the original and the copy) Any suggestions what I should do?
-
I'm a bit at a loss where to put my hooks. My requirement is to have a checkbox in the page (already there) that tells my module to pull fields (i.e. body, headline etc., but possibly others too in the near future) from the default language, no matter if there's a value set in the current language, and apply some replacement before rendering (think HannaCode-like, though with a whole dictionary database for technical terms behind it). Now, I'm unsure where to hook. I've looked through the LanguageSupport modules and tried to spy in HannaCode, but I've not been able to wrap my head around all the getLanguage..., getFormatted... and whatnot hookable methods involved. Attempts at overriding LanguageSupportFIelds::hookFieldtypeFormatValue and extending its logic somehow ended up with an endless recursion. If anybody could give me a few pointers (or method names) I should look for, this would be great.