Skocz do zawartości

[resources.invisionpower.com - pliki] Tips and Tricks > Ordering language bits


Rekomendowane odpowiedzi

Opublikowano

When translating language bits, it can be difficult to find a specific bit because they are recalled in the order that they are stored in the database.

So, when you go to ACP->Look and Feel->Manage Languages->Translate in ACP and click on a template to edit, such as public_error, the first template bit might be reports_need_tidcid

However, if you've imported a secondary language pack, the first template bit might be forward_only_members or any other template bit.. It just depends on how they were stored in the database.

More importantly, if you're searching for one specific template bit, you'd be searching through each of the 14 pages of template bits in that template for the one template bit you might need, and since there's no order.. It could be on any page.

By adding a simple order statement, you can alphabetize the template bits, and make it much easier to find the template bit you are looking for.

In /admin/applications/core/modules_admin/languages/manage_languages.php find this code..

       //-----------------------------------------
       // Get the words
       //-----------------------------------------

       $this->DB->build( array( 
                               'select' => '*', 
                               'from'   => 'core_sys_lang_words', 
                               'where'  => "lang_id={$id} {$wp_query} {$search} {$filter}",
                               'limit'  => array( $st, $per_page ),
                       )    );

and change it to

       //-----------------------------------------
       // Get the words
       //-----------------------------------------

       $this->DB->build( array( 
                               'select' => '*', 
                               'from'   => 'core_sys_lang_words', 
                               'where'  => "lang_id={$id} {$wp_query} {$search} {$filter}",
                               'limit'  => array( $st, $per_page ),
                               'order'  => 'word_key ASC',
                       )    );

This will make finding the template bit you are looking for much simpler, and make all your language packs consistent when editing them. Wyświetl pełny artykuł

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.