Search the Community

Showing results for tags 'language'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 65 results

  1. Hello, I am just working on a multi-language pw app. Default language is german, then comes english. the language segment for english in the url is 'en-home' , eg. '../en-home/products', I think this was taken as a default option. (this happened several months ago, so I do not remember exactly...). Now I want to change this segment simply to 'en'. However, in 'Pages...Settings', only the part AFTER 'en-home' is editable, so I do not see any possibility to change this segment. Neither do the Languages Settings offer such a possibility ;-(( Or do I miss something?
  2. How can I upload files without changing the original filenames? I use processwire in English and Japanese. When I upload a file, the filename is sanitized and changed to an alphanumeric name. I need some files to be uploaded with original filenames with Japanese characters (2-byte characters). Is there a good way to do this? Thanks in advance, Yu
  3. Started my first demo multilingual site last night and I'm really pleased with the ease of setup. I had a 1 page demo with 5 languages and a language switcher and menu running relatively quickly. Before I get too far down the road, I thought I'd ask some of you more experienced multilingual devs what I should be aware of? Off the top of my head... Do any multi-lingual SEO modules exist or should I build my own fields here? I normally use MarkupSEO but not sure yet if it supports multi-lingual. Are any of the Pro fields NOT multilingual? I'm using a single tree with language options as tabs on each field. Is this a better method than having a separate tree for each language? Are image Description fields multilingual? Anything else I should be aware of? For example I read recently that web forms using FormBuilder should be built separately for each language. That's not a huge deal but a good example of something I hadn't anticipated. Cheers P
  4. I was trying to fix an error earlier which was preventing a series of if statements from working. Basically I have a button called "Product Drawing" which needs localising depending on the current language session. Eventually got it working - I had a bracket in the wrong place. Curious as to why both these work though. On the sample below. each echo is surrounded by curly braces. <?php if ($page->files->count()) foreach($page->files->findTag('drawing') as $file) { if($user->language->name == 'default') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Product drawing</a>";} if($user->language->name == 'french') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Le plan du produit</a>";} if($user->language->name == 'german') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Produktzeichnung</a>";} if($user->language->name == 'spanish') {echo "<a href='$file->url' class='uk-button uk-button-primary'>El dibujo del producto</a>";} if($user->language->name == 'italian') {echo "<a href='$file->url' class='uk-button uk-button-primary'>Il disegno del prodotto</a>";} } ?> On the sample below, there are no curly braces around the echo <?php if ($page->files->count()) foreach($page->files->findTag('breakingreport') as $file) { if($user->language->name == 'default') echo "<a href='$file->url' class='uk-button uk-button-primary'>Breaking strain report</a>"; if($user->language->name == 'french') echo "<a href='$file->url' class='uk-button uk-button-primary'>Le test de rupture</a>"; if($user->language->name == 'german') echo "<a href='$file->url' class='uk-button uk-button-primary'>Bruchfestigkeit bericht</a>"; if($user->language->name == 'spanish') echo "<a href='$file->url' class='uk-button uk-button-primary'>Informe resistencia</a>"; if($user->language->name == 'italian') echo "<a href='$file->url' class='uk-button uk-button-primary'>La rottura rapporto ceppo</a>"; } ?> Should the second piece work?
  5. 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?
  6. I'm building a multi-language site and wanted to know the best way to deal with images. Because on a multi-language site, they may want a different image for a different language, especially if the image has text in it. What is the best way to deal with this? Should I make another image field for spanish and if they don't put anything there, just use the english image and if there is a spanish image, then use that image for spanish?
  7. I have to languages - english and russian. I need russian language to be set as default for admin panel. How to do it? Thanks!
  8. Is there a way to tell if a field is a multi-language field? I am currently checking to see if the last 8 characters are 'Language' but that seems like a fragile solution.
  9. Hi there I want to render a page in a particular language, somehow like $page->render('de'). How can I achieve that? Some background information to my problem: I wrote a module that generates HTML newsletter emails. From the PW backend I use that module to send emails, which are represented by pages that are rendered and sent off. Now I want to control the email language. The email shouldn't be just rendered in the language of my backend user account, of course. Any help is much appreciated. Best, Daniel
  10. Hello everyone. I have strange things happening when I want to edit Site translation files. When I try to edit files I got error: " Session: File does not exist: /site\templates\include\footer.inc (translation file not needed? textdomain: site--templates--include--footer-inc) " Here I noticed strange division on left. Somehow it is change direction. Can anyone explain to me why this is happening, and can cause this error?
  11. There's a permission for allowing editor to use the translator in PW 2.73. I could need this but it doesn't work. It shows the "Language" in the menu but when opening the page it says no entries to show. Anybody has some experience using the lang-edit permission for editor?
  12. I while ago, I started a site on dev branch 2.5.19, and built out a bilingual site in English and French. My default language is English and I added French as a second language. I'm using LanguageSupportPageNames and my homepage names are "/" for english and "/fr" for French. Everything works great. But... now the client wants to change the site so that French is the default language. I've tried: setting the Guest user's language preference to French - no effect. detecting the URL and manually setting the $user->language in _init.php variations on naming the homepage "en" and "fr" istead of "/" and "fr", but the redirect still seems to redirect the homepage URL of the default language to "/" even if I've specified "en". I've looked at the LanguageSupportPageNames settings and have tried both the recommended option and including the redirect in combination with URL detection. Still can't get it working. Does anyone have any recommendations? I really don't want to rebuild the site from scratch just to reset the default language :-( Thanks for your help, -Brent
  13. I enabled language support and now I get "Trying to get property of non-object" for lines like: <p><?= $page->text ?></p> The content is still available in the backend. On another page I get text from the frontpage with: <?php $somepage = $pages->get(1); ?> ... <p><?= $somepage->text ?></p> This outputs the text although on the frontpage it doesn't. I also do this on the header. On the frontpage I added some fields that are thus "shared" among all pages the content fails with the error for `<?= $page->text ?>` but not for `<?= $pages->get(1)->text ?>`. On a third page everything works as expected All three pages have different templates. Additionally if the field is wrapped with frontend editing like so: <p><edit text><?= $page->text ?></edit></p> The page source will end up like this: <p></edit></p> Before having to dig deep into this: Any idea what it could be? I var_dumped $page and that gives an object.
  14. Hello, Forgive this newbie, but I could not find a solution for this "simple" issue. I have a multi-language website and I would like to output the current language's name on my menu. I was able to generate the language switcher/navigation without a problem, but I cannot figure out how to echo the current language. Thanks!
  15. I have a web page where all templates have Norwegian (default language) and English (secondary language, ID 1036). Many of my pages have been imported using the API, and so I used a method from How to set language = active via API? to set the secondary language active. Now I want to output a list of pages where the secondary language is inactive. I have tried the following without luck: $pages->find("template=basic-page, status1036=0") But this gives an error: Field does not exist: status1036 Is there another way that makes this possible? Additional information: basic-page was just an example, I should have been more clear from the beginning. I have multiple templates and a totalt of 170 000 pages to check.
  16. Here's my first serious attempt at a PW module. I have the need that pages shouldn't be "published" in all languages at once, so I've put together a PageLangPublish module. It adds both buttons for publishing/unpublishing of each language to the page tree and status icons (from image fields added to each page in admin/languages) next to the page title in the tree. You can find the module at github under https://github.com/BitPoet/PageLangPublish I've probably done a lot of things quite awkwardly (even incorrectly) there, so I'd be grateful for any pointers and ideas. The module also adds a hookable isLanguageViewable method to the Page class. Usage example: $topnav = array(); foreach($homepage->children as $item) { if( $item->isLanguageViewable($user->language) ) { $topnav[] = "<a class='topnav' href='{$item->url}'>{$item->title}</a>"; } } echo implode(" | ", $topnav); Here's a screenshot:
  17. I've spent few hours at this problem, but still can't solve it - // this code works not as expected - outputs only in default language, even if $user->language is different. echo $user->fields->get("some_text_field")->label; // while this code in the same php file works as expected - output follows $user->language echo $page->any_field; Note: some_text_field field label is a multi-language field, all translations available. If I try to do something like this: echo $user->fields->get("some_text_field")->label->getLanguageValue($user->language); it returns: Please, help - I want to output field label in current language! )) Thanks!
  18. Hello, I am running PW 2.7.2 with the image-extra module, which I installed with the multi-language support. But I found it irritating to have all image extra fields twice on the backend because I do not intend to add a second language. So I disabled the multi-language descriptions of that module, but the fields did not vanish. Maybe I played a little with that language support module - uninstall, install again - and now the setup -> languages Tab shows " This page has no process assigned". And now the Image-extra-fields do not contain the content I add. I had a look at the database and found a caption field like " {"0":"","1018":"Steinguss"} " I can edit the field after the "0": and get the result on the page. But on the backend the default-field points to something ending up with _1016 and the second field with _1018. How can I repair this?
  19. Preamble: Processwire is awesome and the freedom of development is quite insane. Issue: When using CKEditor and entering a URL, it says: "Enter a URL, email address, anchor, or enter word(s) to find a page." I have installed the multilingual module, so I need to target: /en/contact/ and /de/contact/ and /lt/contact/ Adding a link to the text, I can only add one of those 3 contact links. When copying the text (including links) into another body (another language), then I need to edit each link to set the correct language - every time. Idea for solution: Is it possible to allow entering either: 1. The page id (then the module could read this and create a URL), or: 2. A placeholder for the language, e.g. "*contact" (then the module could replace the asterisk with the language identifier) Thanks in advance for your ideas.
  20. Working with a multi-language site. I have a field 'province' with the list of provinces in Options in English and in French tab. The field is selectable in the 'municipality_page' template as a dropdown box. I have an Ajax call to retrieve the choice of the province to list the municipalities of that province. Everything works well in English, however, I am having an issue with the French, I don't know if it is because the French provinces uses accents and dashes in them. I was able to make it work for 9 out of 12 provinces with the following code. $province = $_GET['prov']; if(strpos($province, "-") !== false){ $choice = str_replace("-", "|", $province); } else { $choice = $province; } $entries = $wire->pages->find("template=municipality_page, province%=$choice"); Just can't figure out how to get 'Colombie-Britannique', 'Nouvelle-Écosse' and 'Territoires du Nord-Ouest' to be found. I tried manually with the code below, but it didn't even worked. It also doesn't seemed to be a typo in the field. $entries = $wire->pages->find("template=municipality_page, province%=Colombie-Britannique"); What is missing in the code to be able to find those 3 provinces?
  21. Hi, I am looking for a new cms to devellop the new version of my site. I have used joomla and modx but it was not really for me. maybe processwire is more for me? Can I do the following with this CMS? Use data in an external database (same server or other then site) to populate data on pages. (lists and detail pages) Add, delete, adapt entries in that database (through forms on frontend of the site) use my php and sql “knowledge” to adapt/create the above. (create custom php forms and php pages) create a multinlangual site (easy to add a language/tanslate file to be able to add languages) (optional: give users the option to use facebook/google or site registration) This for an event database website where: there is a hierarchical category system users can create an account/change their password logged in users can add/update/delete and search events. visitors (also not logged in) can add,search events. normal users can only acces front end even when logged in admin users can acces front and back end tnx for any replies
  22. Hello all. I have a question that I know must have a simple answer but I've been unable to find it in the forums or documentation. I want to throw a styled bit of markup around the links to switch language on a given page, but I don't want to output the markup if there is only the default language available and therefor no links to output. I was approaching this by trying to count the languages for the page which are marked in the settings tab as active, but I can't seem to find the correct syntax for that. I'm using the basic recommended method to generate the links but nothing in these lines helped me find the answer. foreach($languages as $language) { // if user is already viewing the page in this language, skip it if($language->id == $savedLanguage->id) continue; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // set the user's language, so that the $page->url and any other // fields we access from it will be reflective of the $language $user->language = $language; // output a link to this page in the other language $language .= "<li class='language' style='float: left; display: inline; padding: 1em;'><a href='$page->url'>$language->title</a></li>"; } I tried count($languages) but that includes inactive languages in the count. I tried count($page->viewable($language)) and a few other inventive lines with no results until I decided to finally just ask here. I'm of course open to using some other calculation to determine whether to output my code. Appreciate the help!
  23. Hi all, We have this huge website (over 7000 pages and a few dozen templates). We've used TextLanguage and TextAreaLanguage fields for all textual fields, and all image and file fields have their own description input boxes for different languages too. Now we'd need to export all pages and send them to our translator so they can translate all site contents with their specialized programs, and a way to import the translations back to our site alongside the content in original language. Has anyone done anything similar to this? How did you solve it? Maybe there already is a solid way to do this, or an idea we've not thought of yet. Thanks for any thoughts!
  24. Hi folks, I have a site set up for a festival of events over the next 5 years. Each year (page with children) in the site is in a different location and we want to use the Multi-Language Support to toggle between the native language of the location and English. I have set up the Multi-Language Support stuff fine but the only issue is that it's applying it to the whole site whereas I only need to use specific languages in specific sections. For example, for a Portuguese section a URL might be http://www.domain.com/pt/designing-respect/home/ whereas I need something like http://www.domain.com/designing-respect/pt/home/ instead and on another section for a Chinese section a URL might be http://www.domain.com/designing-politics/cn/home/ so the language support is being applied to the section rather than all of them to the same whole site. This is also the case with using multi-language title fields; it's adding all the options to all the pages whereas I need them only on the relevant sections (so within the Chinese section you'd get the English title field and the Chinese title field; not all the language title fields). Any ideas?
  25. Hello, I noticed today some strange behaviour in connection with the multi-language plugin. I wanted to create a multi-language page and to display the languages in the frontend. To make it more fancy I wanted to add a flag icon to every language. So I used an image field I already had (image_small) and added it to the language-template. So far so good. Then I uploaded two icons and tried to fetch them in the frontend. I have the languages default (English/Englisch) and de (German/Deutsch) and the following code: <?php echo 'active|'.$user->language->image_small->url; foreach($languages as $language) { echo $language->title.'|'.$language->image_small->url; } ?> Result on an english page: active |/site/assets/files/1021/united-states.png English |/site/assets/files/1021/united-states.png Deutsch|/site/assets/files/1081/ Result on a german page: active|/site/assets/files/1081/ English|/site/assets/files/1021/ Deutsch|/site/assets/files/1081/ Somehow he can't get the German flag image at all and only the English page the English flag. But if I'm fetching the images from the $languages variable, it works. So I use this temporary as a workaround: <?php echo 'active|'.$languages->get($user->language->name)->image_small->url; foreach($languages as $language) { echo $language->title.'|'.$languages->get($language->name)->image_small->url; } ?> Result English: active|/site/assets/files/1021/united-states.png English|/site/assets/files/1021/united-states.png Deutsch|/site/assets/files/1081/german.png Result German: active|/site/assets/files/1081/german.png English|/site/assets/files/1021/united-states.png Deutsch|/site/assets/files/1081/german.png Everything is fine with this workaround. But why isn't working with the first code? Thanks for any help. Environment: PHP 5 ProcessWire 2.7.2