Jump to content

Search the Community

Showing results for tags 'Multi-Language'.

  • 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

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hi! i have a question about page language url i have a site with 2 language, default and greek. so in my home i set empty the language field for my default language and el (/el/) for my second language. so if i want to navigate from my default lang page to other lang page i just put the /el/ after my domain. my problem is that i want to get the page language url (el/ , en/, de/...) but i can't find the right syntax of $user->language to get it i try $lang = $user->language->name; but i get the name of my lang, i try $lang = $user->language->id; but i get a number (the id of my lang), can anyone tell me if i can get the /el/ using the above syntax?
  2. Puzzled! I'm using the API to create child and grand-children pages in an app with more than one language. When a new page is created, I expect to see it via the API regardless of the current $user->language. However, it's not the case. I see that the pages I save in the API have a status field for the language set to 0. (e.g. status = 1, but status1563 = 0), which causes them to not be found when searching in a different languages than the default one. i.e. $page->children()->count() -------> n $user->language = <some other language>; $page->children()->count() -------> 0 This seems very weird to me, in principle. In practice, is there a different way to change the default behaviour of $new_page->save() to set $new_page->status1563 = Page::statusOn ? Thanks. Merci.
  3. I am just trying ProcessWire's multi-language capabilities for the first time and installed the multi-language profile that comes with the installer. Out-of-the-box the multi-language profile seems to use the delayed output method, called intermediate profile. As I am used to the beginner's profile (direct output) and I usually work on the front-end, I was wondering if it is possible to use the beginner's profile with the multi-language options? Would appreciate your input.
  4. Currently I have a multi-language site. If I want to have an image with a different alt tag for each language I need to use a repeater. I think it would be sweet to have a fieldtype of ImageLanguage that would allow an image to have a separate Description field for each langugae. I think this could make PW more multi-language friendly.
  5. Hello everyone, I have posted about this issue before and didn't get any answers, i think it's because i didn't explain properly what my problem was. I'll try to explain as detailed as possible, as i think this case might help others with the same situation. I have setup a site with custom made templates and multi-language support. I'm using a single tree approach with multi language features: Multi-LanguageUrls, Fields and also static translation. So far, everything is good. In my website i have a Home Page that serves as the welcome page. In it, you have a welcome message and two links, one for the site in Spanish (the default language) and one for the site in English. As i am using multi language page names, the link for the spanish website points to: <a href="nosotros-concepto">Sitio en Español</a> This is the actual "first page" of the site, after the welcome. The English site link looks like this: <a href="about-us-concept">Site in English</a> The problem is this last link still takes me to the Spanish "nosotros-concepto" and the url looks like this: localhost/mywebsite/es/nosotros-concepto Both links take me to the same Spanish page. I think i have something conceptually wrong, and i would very much appreciate any comments or help on this issue. Anyone else encountered something like this? Thank you all!! Julian
  6. If I have a field for URL, say a page needs to link to another page. If the user is viewing the site in Spanish and that link points to the English version, does it know to output the spanish version of the link? And if so redirect the user to the spanish URL? Is the language the visitor views the site in, kept in sessions or something for it to do this? I'd rather not have 2 URL fields
  7. Hello every body I am starting my first project with ProcessWire for one of my websites newsflames.com But not only that! Moving from simple code I have made to ProcessWire must also add value even this is only changing system step. One of the new features I am planing to add in this step is to add multi language so the main categories structure wold be: (English is default language in homepage and it's categories) Home / -Politics /politics/ - Sports /sport/ - Arabic /ar/ -- Politics /ar/politics/ -- Sports /ar/sport/ - French /fr/ -- Politics /fr/politics/ -- Sports /fr/sport/ And so on.. All categories in website: (Politics Sports Business Health Technology Science) but in this example I use 2 I have download ProcessWire 2.3 from this site and after I install languages modules and tray all the ways I found in this site *note. there is no check boxes! But if I download the zip file from github it's all there plus some other stuff I think. However I still need to add content/pages in languages other than default (English) because some local news that in native language only! So I can't have English as mandatory! simple Example: Home - Politics -- Yahoo! News -- Fox News - Arabic -- Politics -- Yahoo! News -- 123 News - French -- Politics -- Yahoo! News -- abc News And so on.. So I came up with this and I wold say it's all there in PW, I did not invent any thing just for start duplicate the basic-page.php in to category.php and language-home.php and add theme from admin area and assign template with pages: Home -Politics category template - Sports category template - Arabic language-home template -- Politics category template -- Sports category template - French language-home template -- Politics category template -- Sports category template And so on.. I am using default installation with default profile in this example In my case I want the main categories in the top of the page so lets change the topnav Find in head.inc <ul id='topnav'><?php // Create the top navigation list by listing the children of the homepage. // If the section we are in is the current (identified by $page->rootParent) // then note it with <a class='on'> so we can style it differently in our CSS. // In this case we also want the homepage to be part of our top navigation, // so we prepend it to the pages we cycle through: $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } ?></ul> Change to: <ul id='topnav'><?php // Create the top navigation list by listing the children of the homepage. // If the section we are in is the current (identified by $page->rootParent) // then note it with <a class='on'> so we can style it differently in our CSS. // In this case we also want the homepage to be part of our top navigation, // so we prepend it to the pages we cycle through: if ($page->rootParent == "1006") { // Arabic page ID $homepage = $pages->get("/ar/"); // Arabic page URL } elseif ($page->rootParent == "1008") { // French page ID $homepage = $pages->get("/fr/"); // French page URL } else { $homepage = $pages->get("/"); // Homepage URL } $children = $homepage->children("template=category"); // show only pages using template category foreach($children as $child) { $class = $page === $child ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } ?></ul> Simple if condition but it's better to do something else like array or maybe add a field or maybe use the page URL to identity what and where? I don't know for now Now a simple language list and we going to use the subnav style for this example but this time will copy it instead of changing it Add this cod any where in the sidebar $defaultlang = $pages->get("/"); // Homepage URL $languages = $pages->find("template=language-home"); // show only pages using template language-home echo "<ul id='subnav' class='nav'>"; $languages->prepend($defaultlang); // display default language in the list foreach($languages as $language) { $class = $language === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$language->url}'>{$language->title}</a></li>"; } echo "</ul>"; It works just fine except that if you are in an English sub page like /sports the English link class will not be on (problem only in default language that if you want the css effects) // $class This may not be good for you if you plan to go back later for the great language module especially for large data! I only have 6 pages for every language plus news sources and all the news is cached but not saved so I can go back to use languages modules any time I want in this website Fell free to ask any thing about this If you can help improve or have any ideas please do
  8. Hello, I've recently updated a showcase website for (private) antique collection. http://agcat.net/ Module I used: - Procache - Batcher This website is expected to be written in Japanese/English, but English texts are not available yet. Developing this website, I thought Processwire would be a fantastic solution to organise and show cultural heritage such as museum collections!
  9. Hi there, I worked on making apeisas great Thumbnail module translateable (I need a German translation of the UI), but can't really get it to work. I hope that someone here can give me a pointer in the right direction on this. This is what I did: 1. Installed the LanguageSupport module via ModuleManager. 2. Added the German language pack to the Default language. => Everything worked great until now, the backend is mostly translated. 3. Since a lot of strings in Thumbnail weren't translateable, I went through the code and added $this->_() and __() where needed (referring to how it is done with core modules). You can find this version here: https://github.com/boundaryfunctions/Thumbnails/tree/translateable This is the commit adding translatable function: https://github.com/boundaryfunctions/Thumbnails/commit/c3bcb8af480d91bc8ee7cfd4477aadeeab6a708e 4. Using the Language Translator in the backend, I added translation files for each of the three module files of Thumbnail to my default language. I uploaded all three translation files I created (not the best translations at this point, to be honest) here: https://gist.github.com/d41fe1e71791fccf5cc4 5. All of the things I translated aren't translated in the backend, I'm still displayed plain English. Any idea what I might have done wrong here? I really don't get it, because these steps worked perfectly for me until now. Any help is much appreciated. With kind regards, Marc
  10. i've used "Example 3: Display a different language based on URL pre-segment" from the guide to make a site multi-language capable.. my language gateway looks like: <?php $user->language = $languages->get($page->name); $path = '/'; foreach($input->urlSegments as $segment) { $path .= $segment . '/'; } $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); //replace local navigation links $out = $mypage->render(); $regex = '{(<a [^>]*href=["\']' . $config->urls->root .')(["\']'; $topnav = $page->parent->children(); foreach($topnav as $p) $regex .= "|" . $p->name; $regex .= ")}"; $out = preg_replace($regex, '$1' . $page->name . '/$2', $out); echo $out; the regex works quite well for everything else, but but kind of skews up on the 'blog/news' page which uses pagination. besides the fact that the pagination links end up as 'site.com/blog/blog/page2' instead of 'site.com/blog/page2', even when manually entering 'site.com/blog/page2', 4040 error is thrown. I'm guessing that things go bad here: $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); since "path/to/page/page2" will not not return a page. Also, removing the "throw new 404" line, I end up with a blank page. Any suggestions? Thanks,
  11. Hi, As the title says, my code looks like this: $aPage = $pages->get('selector'); $default = $languages->get('default'); $language1 = $languages->get('language1'); $language2 = $languages->get('language2'); $aPage->setOutputFormatting(false); $aPage->title->setTrackChanges(true); // remove this and title will be empty $aPage->title->setLanguageValue($default, 'title'); $aPage->title->setLanguageValue($language1, 'title1'); $aPage->title->setLanguageValue($language2, 'title2'); $aPage->save(); The reason I'm asking is I can't find any mention of this in the documentation and it took quite some time to figure out.
  12. Here is a site I made for the Learning Center I do IT for. My goal was an interactive and responsive feel. Still to add some more media like pics and such, but it's the V1.0. The client is able to add new 'curriculums' and such through the admin gui by only typing a short description, and adding an icon image. http://www.i-workshop.com.cn/
×
×
  • Create New...