1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Removing unused phrases

Discussion in 'XenForo Questions and Support' started by Garamond, Jun 8, 2014.

  1. Garamond

    Garamond Well-Known Member

    After having installed a mature number of add-ons over the years (around 70), we reduced them considerably after upgrading to 1.3. That resulted in an xml-file ripe with unused phrases, which I would very like to clean up.

    I guess there aren't any easy ways to do this, and in that case I would like to make this a feature request for a future version.
     
  2. Liam W

    Liam W Well-Known Member

    When an addon is uninstalled, phrases for it are removed from the database...
     
  3. Garamond

    Garamond Well-Known Member

    Not from the .xml-file, I'm afraid.
     
  4. Liam W

    Liam W Well-Known Member

    Which XML file?
     
  5. Garamond

    Garamond Well-Known Member

    The language.xml file you get when exporting your language. I use that when translating.
     
  6. Luis

    Luis Well-Known Member

    This is not correct Liam, if you translate an addon or modify a phrase, uninstalling the addon the phrases translated or modified are not deleted. The translation system of XenForo needs improvement in some aspects.

    Garamond there is a way to do this, although it is a tedious job. You need to install this addon of @guiltar http://xenforo.com/community/resources/developer-kit.246/, which gives you the ability to filter the phrases by addon. After filtering the phrases per addon you only have to revert and phrases disappear the database.

    Sorry for my poor english.
     
  7. Garamond

    Garamond Well-Known Member

    Thanks for the tip, Luis. But I already tried that add-on, and all it does is filtering the installed add-ons. Uninstalled add-ons doesn't show up at all, even if the phrases are existing in the xml-database.
     
  8. Luis

    Luis Well-Known Member

    That's right Garamond and I had forgotten.

    You can do this in two ways, the simplest is:

    * - Create a new language.
    * - Now you need to export independently the files of the translation of XenForo and of the addons installed from old language and import it into the new language.
    * - Once it this is done you need to set the new language as default and then you can delete the old language.


    But if you want to keep the same ID in the language is necessary to do otherwise

    * - First you need to export independently the files of the translation of XenForo and of the addons installed.
    * - Now you need to export the language completely, selecting "All" in the moment of exportation
    * - Now you need to open the last file exported with an editor (eg Notepad ++)and empty all the phrases of file, leaving the language settings. You'll get something like this:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <language title="EspaƱol" date_format="j M Y" time_format="H:i" decimal_point="," thousands_separator="." language_code="es-ES" text_direction="LTR">
    
    </language>
    
    You can also use this code changing the parameters highlighted in red for the parameters of configuration of your language.

    Now you have all the phrases in the master language (English) and the phrases of the addons uninstalled no longer exist in your database. Now you only need to import the phrases of XenForo and of the addons installed.

    Please make this check in a test forum before performing in a production forum.
     
    Garamond likes this.

Share This Page