Jump to content


Photo

Import language from xml


In the PCA, when importing an XML language, customized entries are added/updated in any language packs.
Packs 'en_US', 'fr_FR' and all the others are exactly identical.


Steps to reproduce this bug (with only two packs):
  • Copy the language pack 'English (USA)'
  • Edit the new language pack and change title and locale:
    • Title: Test (TEST)
    • Locale: fr_FR
  • Customize some entries in the new pack with ACP ('login_to_acp', 'your_cp', 'sj_help' in my case)
  • Export this new pack
  • Delete it
  • Now, import xml file
  • Click on 'Translate' for pack 'English (USA)' and check you have some customized entries (3 in my case)

Status: Fixed
Version: 2.3.0 Beta 1
Fixed In: 2.3.0 Beta 1


19 Comments

Updating status to: Duplicate

Yeah. Already fixed for next update.
Is there a workaround, because it's the "showstopper" to bring my site online with IPB :(
The bug still exists for me in 3.0.1 :(
(I even made a frash install with 3.0.1)

The bug still exists for me in 3.0.1 :(
(I even made a frash install with 3.0.1)


Pm me a copy of the language pack you are trying to import please. Unless there has been a regression, this should already be fixed...
PM send :)
Updating status to: Fixed
Updating severity to: 3 - Medium
Issue fixed in: 3.0.2

In admin/applications/core/modules_admin/languages/manage_languages.php

Find

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
				{
					//-----------------------------------------
					// Don't update default version
					//-----------------------------------------
					
					unset( $db_array['word_default_version'] );
					
					$counts['updates']++;
					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
				}
				
				//-----------------------------------------
				// Lang bit doesn't exist, so insert
				//-----------------------------------------
				
				else
				{
					$counts['inserts']++;
					$this->DB->insert( 'core_sys_lang_words', $db_array );
				}

change to

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
				{
					//-----------------------------------------
					// Don't update default version
					//-----------------------------------------
					
					unset( $db_array['word_default_version'] );
					
					$counts['updates']++;
					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
				}
				
				//-----------------------------------------
				// Lang bit doesn't exist, so insert
				//-----------------------------------------
				
				else if( !$lang_entry['word_id'] )
				{
					$counts['inserts']++;
					$this->DB->insert( 'core_sys_lang_words', $db_array );
				}


(Change else to else/if)

Updating status to: Fixed
Updating severity to: 3 - Medium
Issue fixed in: 3.0.2

In admin/applications/core/modules_admin/languages/manage_languages.php

Find

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
 				{
 					//-----------------------------------------
 					// Don't update default version
 					//-----------------------------------------
 					
 					unset( $db_array['word_default_version'] );
 					
 					$counts['updates']++;
 					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
 				}
 				
 				//-----------------------------------------
 				// Lang bit doesn't exist, so insert
 				//-----------------------------------------
 				
 				else
 				{
 					$counts['inserts']++;
 					$this->DB->insert( 'core_sys_lang_words', $db_array );
 				}

change to

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
 				{
 					//-----------------------------------------
 					// Don't update default version
 					//-----------------------------------------
 					
 					unset( $db_array['word_default_version'] );
 					
 					$counts['updates']++;
 					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
 				}
 				
 				//-----------------------------------------
 				// Lang bit doesn't exist, so insert
 				//-----------------------------------------
 				
 				else if( !$lang_entry['word_id'] )
 				{
 					$counts['inserts']++;
 					$this->DB->insert( 'core_sys_lang_words', $db_array );
 				}


(Change else to else/if)


Just tried this, and this fix don't work for me... :(
Photo
mada mada dane
Jul 17 2009 01:40 PM
It works for me.
It's not going to fix the ALREADY messed up languages, only new imports, if that's what you mean.
Hello

No, it don't work for me too.

1) I install a new IPB 3.0.1
2) I apply your patch
3) I import my french pack

After this, english pack is translated in french.
Send me your French language pack in a PM and I'll try to import it to see what happens.
Dont mean to be rude, but dont you test those patches that are supposed to fix bugs?

I really think you should consider to slipstream those "fixes" into the current 3.0.1 package so customers who download the latest package dont have to start by issuing tickets about a bug that was supposed to be fixed in 3.0.1.

Dont mean to be rude, but dont you test those patches that are supposed to fix bugs?

I really think you should consider to slipstream those "fixes" into the current 3.0.1 package so customers who download the latest package dont have to start by issuing tickets about a bug that was supposed to be fixed in 3.0.1.


Updating status to: Fixed
Updating severity to: 3 - Medium
Issue fixed in: 3.0.2


It's fixed in 3.0.2 not 3.0.1 ;)
Yes, I test the patches. Yes, I tested this patch DOZENS of times. Do you have ANY idea how many language packs I've imported into my local installation in the last month?

No, we are not going to live-update a main download to include bug fixes. The issue will be fixed in 3.0.2.

I cannot reproduce what Youp3 is stating. I import a language pack, it doesn't translate the English pack. End of story. That's why I asked for a copy of his language pack just to test, to make sure I'm not missing something (e.g. some setting that might change the behavior).
I performed the instructions, but after you have imported the xml language file, you duplicate the first entries of each application.
Example:

Edit word pack: "core/public_help"  
Default Value 2x (topic_text)

9 were originally, now they are 10, This happens in all forms of language imported.

Posted Image


Thank !!!

Updating status to: Fixed
Updating severity to: 3 - Medium
Issue fixed in: 3.0.2

In admin/applications/core/modules_admin/languages/manage_languages.php

Find

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
				{
					//-----------------------------------------
					// Don't update default version
					//-----------------------------------------
					
					unset( $db_array['word_default_version'] );
					
					$counts['updates']++;
					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
				}
				
				//-----------------------------------------
				// Lang bit doesn't exist, so insert
				//-----------------------------------------
				
				else
				{
					$counts['inserts']++;
					$this->DB->insert( 'core_sys_lang_words', $db_array );
				}

change to

if( $lang_entry['word_id'] AND ( !$insertId OR $insertId == $_lang_id ) )
				{
					//-----------------------------------------
					// Don't update default version
					//-----------------------------------------
					
					unset( $db_array['word_default_version'] );
					
					$counts['updates']++;
					$this->DB->update( 'core_sys_lang_words', $db_array, "word_id={$lang_entry['word_id']}" );
				}
				
				//-----------------------------------------
				// Lang bit doesn't exist, so insert
				//-----------------------------------------
				
				else if( !$lang_entry['word_id'] )
				{
					$counts['inserts']++;
					$this->DB->insert( 'core_sys_lang_words', $db_array );
				}
(Change else to else/if)


I have do this fix but isn't helphing.
I can not import and also export any language.xml file.


Here my php.ini file : /usr/local/etc/php5/cgi :
;max_execution_time = 900     ; Maximum execution time of each script, in seconds
;max_input_time = 900	; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
;memory_limit = 25M      ; Maximum amount of memory a script may consume (128MB)

; Maximum allowed size for uploaded files.
;upload_max_filesize = 25M


I have compilled php as CGI and my php version is 5.2.10 (cgi-fcgi)

If i make a fresh 3.0.1 install, i have not a problem with import and export a language.xml
Only after upgrade from 2.3.6 to 3.0.1 i have this problem.

Also, if i upgrade my board to 3.0.1 i get on step 7/13 All Task Upgraded a error : 500 Internal Server Error.
But my ACP still works, after login to acp i do :
System->Cache Management->Recache All
After this ACP works fine without errors and board also.

Please anybody help me with this problem, i have sending ticket to support.
They have upgrade my board to 3.0.1 but with same errors :)
Submit a ticket if you are having issues. The ORIGINAL reported bug was resolved with the fix posted. If you are still experiencing issues, you need to submit a ticket.
:)
I have send a ticket 3 days a go, they ask my ftp and acp login.
I have send it, they say :
We have upgraded your forum.
But i have still this problem :)

But i say in my ticket that i have this problem and problems with upgrading to 3.0.1
My problem isn't resolved, i need support.
So you need to REPLY to the ticket stating that you are still having an issue. I'm afraid we cannot provide support through the bug tracker. If the issue isn't resolved, reopen the ticket.