1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Phrase Titles naming convention?

Discussion in 'Showcase Support' started by Ludachris, Feb 20, 2019.

  1. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Hey Bob, do you have a document somewhere that explains the naming convention of the phrases for 2.X? I'm going through trying to edit front-end phrases but I'm not sure if I'm editing phrases for the back-end. Just wondering if there's something I can reference to know if phrases like "xa_sc_..." are front-end or back-end phrases.

    Thanks!
     
  2. Bob

    Bob Developer Staff Member

    There is nothing in Core XF to designate a phrase as a "frontend only phrase" or "backend only phrase". Any phrase can be used anywhere (frontend or backend). When Addons create a phrase, they should in normal circumstances prefix the phrase with the addonID... eg xa_sc_phrase_name (xa = XenAddons, sc = Showcase).

    A large majority of the phrases that I create via the Phrase System are for the Frontend, however, there are several that I also use for both the frontend and backend and there are a few that I only use on the backend (like for Input Forums titles and descriptions).

    There are some non standard phrases that I add (most of these are dynamically created... eg, custom field titles, descriptions, prefixes, content type phrases etc), but those you probably won't even be concerned with (unless you are translating a language and want to translate a Prefix).

    The main ones that you'd be dealing with are xa_sc_phrase_name (Showcase) and xa_ams_phrase_name (AMS).

    Hope that makes sense?
     
  3. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Well damn, it would be nice if XF gave a way to decipher between front-end and acp usage for phrases. Would make editing phrases a lot easier since most admins usually only care about editing front-end phrases/terms. :confused:
     
  4. Bob

    Bob Developer Staff Member

    Its not all doom and gloom.... it is SO MUCH QUICKER to edit phrases in XF2 (even when there are 1000's).

    The BEST way to do it is to Click on "Search phrases", then set the Add-on to "Showcase" (so that you are only searching for Showcase Phrases), then add a term into the "Text contains" example 'showcase' (with out the ' marks). Make sure the language is the correct language (not Master language) and then instead of hitting SEARCH, hit Translate. This brings up an interface that lets you quickly change & save a phrase text or SKIP a phrase (skip removes it from the list). I usually scroll through the list an SKIP the obvious ones that I know are only used in the admin cp (like when the title is name admin_navigation.phrase_name). This cuts down the list making it even quicker. it is so much faster than having to edit each phrase 1 by 1.

    As I test, it took me only a few minutes (less than 10) to replace the term "showcase' with "garage" in 128 phrases. Doing that the old way (1 by 1) it would take an hour or more. Highlight 'showcase', [ctrl v] (paste, which replaces showcase with garage), click save, scroll to the next phrase, repeat until done... SUPER FAST.
     
  5. Bob

    Bob Developer Staff Member

    Showcase Phrases that start with THESE system prefixes are only used in the Admin CP.
    • admin_navigation.
    • admin_permission.
    • cron_entry.
    • mod_log.
    • option.
    • option_explain.
    • option_group.
    • permission.
    • permission_interface.
    • widget_def.
    • widget_def_desc.
    • widget_pos.
    • widget_pos_desc.
    Showcase Phrases that start with sc_ are CONTENT TYPE phrases and are used on both the frontend and backend for content type specific purposes. eg sc_comment, sc_comments, sc_item, sc_items

    Showcase Phrases that start with THESE system prefixes are only used on the frontend.
    alert_opt_out.
    nav.

    Showcase Phrases that start with xa_sc_ are phrases that I add (non system generated). Depending on the phrase, it could be only used in the admin cp or frontend, however a lot of them are used in both areas.

    With all of that out of the way...

    I know you are one that likes to replace the term 'showcase' with 'garage', so just to let you know, out of the 128 phrases that use the term 'showcase', most of them (like 70% or more) are system generated phrases used only in the Admin CP. If you SKIP all of the system generated phrases that are only admin CP systems, that only leaves you a hand full of phrases and out of those hand full, its pretty obvious which ones are used only on the backend (and even if it isn't, its not going to hurt to change the phrase.

    SC 3.0 hardly uses the term 'showcase' on the frontend anymore (mainly uses the generic term 'item' instead). There are cases where the generic term "item" can't be used tho and in that case, I use the term "Showcase item". There are only a hand full of these tho (like the alert opt outs, whats new etc..

    Hope that helps.
     
  6. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    I knew there had to be an easier way... f' me! Thanks a ton Bob. That's WAY easier. And yes, I'm changing Showcase to Garage and Items to Vehicles. The next project will be something different, but the same process.
     
    Bob likes this.
  7. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Question - if I'm running through that Translations page and making tons of edits, do I have to click the Save button for each one I change or will there be a Save All button at the bottom? I'm down near the bottom of nearly 300 phrases. o_O
     
  8. Bob

    Bob Developer Staff Member

    Pretty sure you have to hit SAVE on each one (which is how I explained how I did it).

    The steps I took was first clicking SKIP on all the ones I wanted to skip. Then I went back to the top, double clicked on the term 'showcase' (which highlights it), then did a ctrl-v (which paste's 'garage' over the top of 'showcase', then clicked saved and scrolled down to the next one. The entire process took about 5-6 minutes (roughly).

    I don't think there is a BULK SAVE button anywhere (its probably designed to be AJAX save independently).
     
  9. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Ahhh hell. It's only 296 phrases. Hopefully the session doesn't time out before I make it back up the list :)
     
  10. Bob

    Bob Developer Staff Member

    296? There must have been a lot with 'item' that you wanted to set as 'vehicle' huh? The good thing is that you only need to do it once.
     
  11. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Yeah, the carpal tunnel in my control V hand is acting up. LOL But luckily it's just clicking Save on the way back up the list.
     
    Last edited: Feb 20, 2019
    Bob likes this.
  12. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    So this makes me think of a suggestion - I see you use a "category content term" variable in the category settings for "item". Is there any way to plug that variable into the phrases to make translating the term "item" unnecessary? If so, you could do the same for the term "Showcase".
     
  13. Bob

    Bob Developer Staff Member

    The entire purpose OF the "Category content term" is for use within certain phrases (the implemented suggestion thread for this feature explains this).

    example.... The header of the Item Information Block located in the item sidebar checks to see if the Category has a content term set and if it does, it passes that into a phrase, if not, it uses a static phrase.

    Code:
                <h3 class="block-minorHeader">{{ $item.Category.content_term ?  phrase('xa_sc_x_information', {'term': $item.Category.content_term}) : phrase('xa_sc_item_information') }}</h3>
    
    I can't do 1000's of phrases this way, but I can do the most common ones (which are mainly used on the ITEM pages and Category Pages (on category pages, the Add Item button might say Add Vehicle instead.
     
  14. Bob

    Bob Developer Staff Member

    Example... here you can see that the Vehicles category has a category content term, so the "Add Item" button becomes "Add Vehicle" instead.

    Selection_231.png
     
  15. Ludachris

    Ludachris Active Member AMS Premium Showcase Premium

    Gotcha - I just wasn't sure how widely used the term variable was.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.