"Add New Phrase" In The Language Manager

    • 120 posts
    July 11, 2023 4:13 PM EDT

    Hi,

    Can anyone explain exactly how the "Add New Phrase" works in the language manager! The tutorial (https://community.socialengine.com/blogs/597/65/language-manager) doesn't explain how to implement them! In UNA (Formerly Dolphin) and some others I have tested, when you add a new phrase you also assign a new key along with it, the key is what you use in the code to recall it but at the moment I cannot even see the point/use for it without further explanation!

    I have searched this forum with no results!

    Can someone help please? 

    Mark

    • Moderator
    • 6923 posts
    July 12, 2023 8:46 AM EDT

    Not enough info provided for me to help. Please let me know exactly what you are trying to do. For example, is it a menu, category, custom widget, etc?

    • 120 posts
    July 12, 2023 11:54 AM EDT

    Well, I just want to know if you add a phrase, how do you use it! It just seems it doesn't actually do anything.

    Just more of a tutorial really. 

    • Moderator
    • 6923 posts
    July 12, 2023 12:59 PM EDT

    That's too vague though as it depends on where you are using it. It's like asking a pro chef to tell you how to bake but not saying what you want to bake.

    For example, let's say you make a widget on the member home page. You want to have the title be translatable. So you make the title in the widget Looms. Then, you add the phrase Looms in your phrase manager. Our script makes it simple to add a phrase like that. As you can see, no need to fiddle with assignments or whatnots. Just add the phrase and then translate it in each language pack.

    Widget with title:

    Added "Looms" phrase:

    Bingo! I can translate it:

    It shows if someone chooses Spanish language as that's what I translated it to:

    Easy peasy but I don't know if that's the cake you wanted.

    • 120 posts
    July 12, 2023 1:13 PM EDT

    Ok, a bit more clear but I do think you should explain this a bit more in your tutorial.

    However, let's just say I want to do a bit of custom coding and include a new phrase. What would I use in the code to recall the new phrase (this is where I don't understand that there is no key!)? 

    • Moderator
    • 6923 posts
    July 12, 2023 2:05 PM EDT

    Well that's coding and not the same as the other stuff. You should use the available coding tutorials for that. https://community.socialengine.com/blogs?category_id=33 there is a "hello world" downloadable plugin example in this https://community.socialengine.com/blogs/597/100/technical-overview as well as details on how to work with csv and translations. That'll show you how to code a plugin and how to use phrases in it. 

    • 120 posts
    July 12, 2023 2:09 PM EDT

    Oh, okay thanks for the help and the example above, your the best! 

    • Moderator
    • 6923 posts
    July 12, 2023 2:11 PM EDT

    You're welcome!I also have about 40 small plugins that I made under my ScriptTechs company. Some are even on this site and a mutual friend's. I can perhaps get some of those to you if you need them for your site but they are not to be distributed to others.

    • 120 posts
    July 12, 2023 2:20 PM EDT

    Well that would be great if you could, I'm a keen learner and of course they would not go any further. 

    However I do have one more question if you don't mind?

    When just examining the en .csv file I notice most of the language is plain English but some are like for example "ADMIN_ACTIVITY_TYPE_VIDEO_NEW" as in the screenshot below, what is the difference?

    Thanks,

    Mark 

    • Moderator
    • 6923 posts
    July 12, 2023 2:32 PM EDT

    I believe because some are variables and the rest are normal phrases such as "No one has posted a video" is a normal phrase. Atm I am not feeling up to par so that's my best guess. If you want to make something specific perhaps post what you need. Some of those could be third party product phrases too. 

    Looking at my video csv file, it is not like yours as you don't have the full phrases. My phrases are:

    "ADMIN_ACTIVITY_TYPE_VIDEO_NEW";"When a user (subject) posts a new video (object)."
    "ADMIN_ACTIVITY_TYPE_COMMENT_VIDEO";"When a user (subject) comments on another user's (object) videos."
    "ADMIN_ACTIVITY_TYPE_LIKE_VIDEO";"When a user (subject) likes another user's (object) videos."
    
    "_ACTIVITY_ACTIONTYPE_VIDEO_NEW";"New videos"
    "_ACTIVITY_ACTIONTYPE_COMMENT_VIDEO";"Comments on your videos"
    "_ACTIVITY_ACTIONTYPE_LIKE_VIDEO";"When I liked the videos"
    
    "ACTIVITY_TYPE_LIKE_VIDEO";"When someone likes one of my videos."
    "ACTIVITY_TYPE_LIKED_VIDEO";"When someone comments on a video I liked."
    "ACTIVITY_TYPE_COMMENT_VIDEO";"When someone comments on one of my videos."
    "ACTIVITY_TYPE_COMMENTED_VIDEO";"When someone comments on a video I commented on."
    "ACTIVITY_TYPE_VIDEO_PROCESSED";"When a video has been processed."
    "ACTIVITY_TYPE_VIDEO_PROCESSED_FAILED";"When a video has failed to be processed."
    "ACTIVITY_TYPE_VIDEO_NEW";"When a new video is posted."
    
    "ACTIVITY_CATEGORY_TYPE_VIDEO";"Videos"
    
    "_CORE_ADMIN_STATS_VIDEO_EMBEDVIEWS";"Video Views from Embedding"
    • 120 posts
    July 12, 2023 2:58 PM EDT

    Just for the record I am not using any 3rd party plugins/themes! 

    But some of those plugins will certainly be appreciated!  

    • 131 posts
    July 12, 2023 7:54 PM EDT

    Mark, it sounds like you have a great idea you would like to implement with "adding a new phrase".  If you don't mind me asking, would this be a phrase only or will you be creating a new module or page? 

    T.~

    • 120 posts
    July 13, 2023 6:43 AM EDT

    No, after the bug I found (https://community.socialengine.com/forums/topic/3328/possible-language-string-phrase-missing/view/post_id/19391) at the moment I just want to understand how it works in SE for testing/diagnostics etc., and maybe use that phrase in a bit of custom coding but a plugin is way out of my league at the moment! 

    • 120 posts
    July 13, 2023 6:50 AM EDT

    Ah Donna,

    I just realized your screenshot above makes more sense to me! I only pointed out the video ADMIN_ACTIVITY_TYPE_VIDEO_NEW as an example, but your screenshot has them in quotes " with a semi-colon, then the phrase, that makes a lot more sense to me.

    So, "ADMIN_ACTIVITY_TYPE_VIDEO_NEW"; is the KEY and "When a user (subject) posts a new video (object)." is the PHRASE! Also, as you pointed out I don't seem to have the full phrases, so are some missing? This is what I am trying to get to the root of really! 

    What did you use to display this csv file?

    • Moderator
    • 6923 posts
    July 13, 2023 7:24 AM EDT

    Glad you got it lol. As for how I posted the csv, when posting code (which I consider this code), use the code button to the right of the smiley. Put your code in that. 

    • 120 posts
    July 13, 2023 7:37 AM EDT

    No not display it here, what did you use to open the file eg. I used Excell! 

    • Moderator
    • 6923 posts
    July 13, 2023 7:39 AM EDT

    LOL duh! I use Sublime Text, Brackets, or Phpstorm.I prefer Phpstorm when coding plugins, making builds, and making bug fixes.

    • Moderator
    • 6923 posts
    July 13, 2023 7:39 AM EDT

    Notepad++ is also another favorite I used to use on windows.