Search

Just posted an issue.

@klaftertief: Bug fixed, thank you for report it!

Viewing section entries on the backend publish page

From what I can tell, the only way to change the language displayed for multi-lingual fields in the publish pages is to change the the order of the languages under the Language Redirect system preference, eg from en,fr to fr,en.

This is not really that practical, if all you want to do is look at the table of entries in a different language. Is it possible — or what would it take — to be able to change this more easily, say from a drop-down on the publish page?

Cheers

@jstar198: With the latest changes to automatically select the default language of an author, the content in the publish page it’s displayed in the language of the author. Then if an author has French selected in his profile he will read the content in french, if has English selected then will read the content en English.

If do you think it’s important to have all translations in the publish page we can find the best way do it, so I accept suggestions, jstar198 suggest a drop-down… any other suggestion?

@guillem_l

Firstly my apologies, I wasn’t using the most recent version of the extension. I’ve updated now and can confirm that changing an author’s language does change the language displayed in entries tables.

For my project, I was going to include a little button at the top of the admin page for switching a user’s language, I guess by simply imitating the form submission from the Authors page. This would be adequate for me, though if you’re thinking of implementing something similar in your plugin, then yes I think either a dropdown which refreshes the page, or some flags which can switch the contents of the table dynamically (in JS).

Thanks for your interest as always!

@jstar198: I am a bit puzzled by the use-case for being able to switch the language displayed in listings by a drop-down or similar. Could you give an example of a situation this is very useful for?

When you edit a specific entry, you do have all language versions available in the form with tabs. So I’m just wondering why you’d want to switch back and forth between different language versions in the listings.

@froded

Sure: I’m building a multilingual website where each entry (in a section called pages) is made up of a number of multilingual fields — title, content etc.

The multilingual editing works great per-entry, but as yet the only way to view all the entries at once in particular language is to change the author’s language from System -> Authors. Even though the site is multilingual, the translations are all handled by a single author who from time to time would what to switch between language in the entries overview.

What I’m essentially talking about here is a faster way for users to switch their backend language and in fact I’m working on an extension as we speak for achieving this. (Will update with link soon).

Update Just completed the new Backend Language Switcher extension.

Okay I should be in bed when I can’t tell the difference between sorting and filtering…

When sorting the data source is it possible to sort not only on the default language but rather on the current language? Im guessing the solution might be similar to the filtering on current language?

No clue if this will have any repercussions on anything else. But changing:

public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC') {
    $field_id = $this->get('id');

    $joins .= "LEFT OUTER JOIN `sym_entries_data_{$field_id}` AS ed ON (e.id = ed.entry_id) ";
    $sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "ed.value {$order}");
}

to this:

public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC') {
        $field_id = $this->get('id');

        $joins .= "LEFT OUTER JOIN `sym_entries_data_{$field_id}` AS ed ON (e.id = ed.entry_id) ";
        $sort = 'ORDER BY ' . (strtolower($order) == 'random' ? 'RAND()' : "`ed`.`value-{$this->_current_language}` " . $order); 
    }

seems to do the trick

@Aalandriel: Just pushed your modification in the repo. Thank you for your contribution!

EEEEk you’re asking me to figure out how git works o.O

@guillem I updated the Language Redirect extension, and there is one incompatible change. The name of the key of the stored language codes in /manifest/config.php changed from languages to language_codes. You have to use

Symphony::Configuration()->get('language_codes', 'language_redirect'))

now to get the language codes.

Ok, I will update the extension for Symphony 2.2 and will include this change.

Hi, I’m using symphony 2.1.2 and I add to it these extensions: “Multilingual Field Extension 1.2” and ” Language redirection 1.0” .

I created a ‘Sections’ named ‘translate’ and I put to it 2 fields: Text Input (label:name) Multilingual Text (label:translation)

When I try to create a new ‘translate’ entity, the symphony page doesn’t shows the language tab ( see attached image )

If I try create an entity, I obtain tis error:

Unknown column 'f.handle-' in 'where clause'

An error occurred while attempting to execute the following query


    * SELECT f.id FROM `sym_entries_data_9` AS f WHERE f.`handle-` = '' AND f.entry_id != '6' LIMIT 1

Backtrace:

    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/toolkit/class.mysql.php:270] MySQL->__error();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/toolkit/class.mysql.php:308] MySQL->query();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/toolkit/class.mysql.php:357] MySQL->fetch();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/extensions/multilingual_field/fields/field.multilingual.php:295] MySQL->fetchVar();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/extensions/multilingual_field/fields/field.multilingual.php:249] fieldMultilingual->isHandleLocked();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/extensions/multilingual_field/fields/field.multilingual.php:700] fieldMultilingual->createHandle();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/toolkit/class.entry.php:147] fieldMultilingual->processRawFieldData();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/content/content.publish.php:561] Entry->setDataFromPost();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/content/content.publish.php:29] contentPublish->__actionNew();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/content/content.publish.php:38] contentPublish->__switchboard();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/toolkit/class.administrationpage.php:70] contentPublish->action();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/core/class.administration.php:88] AdministrationPage->build();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/symphony/lib/core/class.administration.php:204] Administration->__buildPage();
    * [/Applications/XAMPP/xamppfiles/htdocs/pilot.local/index.php:25] Administration->display();

Database Query Log:

    * SET NAMES 'utf8'; [0.0002]
    * SET CHARACTER SET 'utf8'; [0.0001]
    * SELECT SQL_NO_CACHE * FROM `sym_cache` WHERE `hash` = '_session_config' AND (`expiry` IS NULL OR UNIX_TIMESTAMP() <= `expiry`) LIMIT 1; [0.0006]
    * SELECT `session_data` FROM `sym_sessions` WHERE `session` = '338d7a42092155de64f6424bd90d1668' LIMIT 1; [0.0003]
    * DELETE FROM `sym_sessions` WHERE `session_expires` <= '1295521224' OR `session_data` REGEXP '^([^}]+\|a:0:{})+$'; [0.0003]
    * SELECT `id` FROM `sym_authors` WHERE `username` = 'admin' AND `password` = 'd033e22ae348aeb5660fc2140aec35850c4da997' LIMIT 1; [0.0005]
    * UPDATE sym_authors SET `last_seen` = '2011-02-03 12:00:24' WHERE `id` = '1'; [0.0003]
    * SELECT * FROM `sym_authors` WHERE `id` = '1' LIMIT 1; [0.0003]
    * SELECT * FROM `sym_extensions`; [0.0005]
    * SELECT * FROM `sym_sections` ORDER BY `sortorder` ASC; [0.0009]
    * SELECT `name` FROM `sym_extensions` WHERE `status` = 'enabled'; [0.0003]
    * SELECT t1.name, t2.page, t2.delegate, t2.callback FROM `sym_extensions` as t1 INNER JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE t1.status = 'enabled'; [0.0006]
    * SELECT `id` FROM `sym_sections` WHERE `handle` = 'transalte' LIMIT 1; [0.0003]
    * SELECT `s`.* FROM `sym_sections` AS `s` WHERE `s`.`id` = '4'; [0.0003]
    * SELECT `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = '4' ORDER BY `sortorder` ASC; [0.0004]
    * SELECT t1.* FROM sym_fields as t1 WHERE 1 AND t1.`id` = '8' LIMIT 1; [0.0003]
    * SELECT * FROM `sym_fields_input` WHERE `field_id` = '8' LIMIT 1; [0.0006]
    * SELECT t1.* FROM sym_fields as t1 WHERE 1 AND t1.`id` = '9' LIMIT 1; [0.0006]
    * SELECT * FROM `sym_fields_multilingual` WHERE `field_id` = '9' LIMIT 1; [0.0006]
    * INSERT INTO `sym_entries` (`section_id`, `author_id`, `creation_date`, `creation_date_gmt`) VALUES ('4', '1', '2011-02-03 12:00:24', '2011-02-03 11:00:24'); [0.0004]
    * SELECT `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = '4' ORDER BY `sortorder` ASC; [0.0003]
    * SELECT f.id FROM `sym_entries_data_9` AS f WHERE f.`handle-` = '' AND f.entry_id != '6' LIMIT 1; [0.0000]

Any ideas? Thanks DB

Attachments:
create-entity.png

@dbettoni This is because I changed the way the language codes a saved in manifest/config.php as mentioned two posts above. Downloading an earlier version of the Language Redirect extension should help. You have to uninstall the current Language redirect extension befor you install the older one.

Sorry for the inconvenience.

ok, thanks now it runs!

Hi,

I’m working on a webpage in 4 languages. 3 of them are Polish, English and German, they work fine. The problem is that the 4th language is Russian, and, as you probably know, Russian language has completely different character set than ‘Latin languages’. Multilingual Field doesn’t get it right.

When I type “???????? ???-???” (LOL! This happens on this discussion board too, maybe I should change a browser? I’m looking into it now) to the single-line textbox and save changes, I get question marks in the same textbox. They look like this:

alt text

Am I missing something, or this is a bug?

Textfield with a text formatter is okay! Pure textfields are the issue here.

I’ve just taken a look into a database and this is what I found out:

Fields ‘value-ru’, ‘handle-ru’ and ‘value_format-ru’, which are supposed to contain a russian content have a latin2 encoding (this is really strange)! I’ve just changed them into UTF8. Now, when I enter russian data by phpMyAdmin (via normal HTML form fields), everything is fine, russian signs are displayed correctly. However, when I enter them via Symphony panel, I get ???????????? on a webpage and, which is essential, in a database.

The conclusion is that the problem is in sending data via Symphony to a database, the rest is okay. What’s more, phpMyAdmin can do this very well, so it is viable in PHP and Symphony. The question is, where’s the difference and how to fix it? :)

Another question is that it’s my second problem with multilingual field and I get no answers, is there anyone responsible for the extension?

From the forum guidelines:

Etiquette

You’ll find this forum incredibly responsive most of the time, but remember that it’s run by members who are basically volunteering their own time. Please keep in mind that no member is particularly obligated to follow-up on a thread.

guillem_l is the developer and maintainer of this extension. Be patient, he will address your problem if he finds the time.

In Symphony’s manifest/config.php under the database, make sure both character_set and character_encoding are utf8.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details