Forum

This forum is now read-only. Support is provided at https://wordpress.org/support/plugin/sermon-browser/

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Translating things which aren't on the POT file
11 February, 2013
12:59 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

Hey!

I've come across with three terms, which I haven't found on the POT file but would need to translate: "ascending", "descending" and download link's "download".

Does anyone have suggestions what's the best way to go about it?

Thanks!

-Tsuua

11 February, 2013
7:44 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua,

Here is a solution for you.  It requires edits to sb-includes/frontend.php.

Before you begin, of course, it is important to back up any file that you might be changing.  Then if something goes wrong, you can restore your file before you made any changes.

 

First, around line 706, you'll find a function named sb_print_url_link( ).  On the second line of the function (next after the "function sb_print_url_link($url)" line, add the following line:

    global $sermon_domain;

Then, toward the end of the function, you'll find the following line:

        echo ' <a href="'.sb_display_url().sb_query_char().'download&amp;'.$param.'='.$url.'">Download</a>';

Change that line to this:

        echo ' <a href="'.sb_display_url().sb_query_char().'download&amp;'.$param.'='.$url.'">'.__('Download', $sermon_domain).'</a>';

Here is the whole function with changes:

http://pastebin.com/qffb5gbH

 

Next, somewhere around line 894, you'll find the function named sb_print_filters( ).  This function is in two parts: The first part is for "One click filter" and the second part is for "Drop-down filter."  In the Drop-down filter section, you'll find a group of lines that looks like this:

        $di = array(
            'Ascending' => 'asc',
            'Descending' => 'desc',
        );

Change those lines to this:

        $di = array(
            __('Ascending', $sermon_domain) => 'asc',
            __('Descending', $sermon_domain) => 'desc',
        );

The whole function, including both these changes and the ones from the previous translation-fix topic, is here:

http://pastebin.com/QX13TnJ2

 

That's the first part, which shows the edits that need to happen to the frontend.php file.  The next part will show what you need to do to the .po translation file.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
7:55 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Next, you need to add these lines to your sermon-browser_xx_XX.po file for whatever language you are working with:

http://pastebin.com/SYzmXKxE

In each of the "msgstr" lines, add your translated text inside the empty quotes.

 

One note about the line numbers: The line numbers in the pastebin above that you see after "#: frontend.php:" are not critical; it is just a comment.  So if they don't exactly match the line numbers in your frontend.php, it is okay.  Feel free to change the line numbers to match your file, or just leave it.  It should work either way.

 

Finally, compile your .mo file, and FTP both the .po and .mo file over to your website.

 

As always, if you have any trouble or any questions, please feel free to ask.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
10:49 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

Great! Thanks Ben. I got this message after uploading the new frontend.php:

Parse error: syntax error, unexpected T_GLOBAL, expecting '{' in /home/content/19/7891619/html/ls/katekismus/wp-content/plugins/sermon-browser/sb-includes/frontend.php on line 707

11 February, 2013
10:51 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua, could you post your entire frontend.php file into http://pastebin.com and let me see it?

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
10:59 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline
11 February, 2013
11:02 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua,

On line 706 of your frontend.php, somehow you lost the { character that begins the function.  Change line 706 to this:

function sb_print_url_link($url) {

 

Let me know if you are still having trouble.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
11:11 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua, I see another problem that you will have, on lines 1013, 1014, and 1015.  Get rid of the numbers at the beginning of those lines.  Change them to this:

http://pastebin.com/6dBNBqhi

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
11:18 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

That worked out but the next issue is on line 1013. I tried to look at it but it didn't seem to be the same issue this time:

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/content/19/7891619/html/ls/katekismus/wp-content/plugins/sermon-browser/sb-includes/frontend.php on line 1013

11 February, 2013
11:22 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

See my last post above.  :)

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
11:34 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

Haha. You're so efficient.

For whatever reason, though, a problem seemed to stick on line 1013. 14 and 15 got solved, though..

11 February, 2013
11:43 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Could you post a fresh copy of your frontend.php to http://pastebin.com/ ?

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

11 February, 2013
11:46 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline
12 February, 2013
3:36 am
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua,

On line 1013, you still have a "2" at the beginning of the line.  Get rid of it.  Your lines 1013, 1014, and 1015 should look like this:

http://pastebin.com/6dBNBqhi

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

12 February, 2013
9:58 am
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

Uh, I didn't realize that was an actual number.. You live you learn. Thanks! It works perfectly now. Thank you!

One last translation question and then I'm all sorted out: For some weird reason bible book translations don't pick up on the 'add sermon' page. On the frontend, I get the Finnish names, but when choosing the book in admin panel, the names are in English. Now, it's not the end of the world if it can't be fixed, but it would make the users' uploading process easier if I got the bible book names' translation to kick in also in the back-end.

Here's a photo of it, as you can see everything else is translated to Finnish: http://tsuua.com/ls/katekismus......50.14.png

12 February, 2013
4:53 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua,

This one requires an edit to /wp-content/plugins/sermon-browser/sb-includes/admin.php.

The changes are in a very long function called sb_new_sermon( ), which you will find in lines 1308 - 2002.  Here is the new function with the changes you'll need:

http://pastebin.com/eYsHhHwR

Replace your existing function with the one at the Pastebin.

Let me know if you have any questions or trouble with it.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

13 February, 2013
9:44 am
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

Thanks Ben!

That worked well.

9 March, 2013
10:29 pm
Tsuua Kekale
Enthusiast
Members
Forum Posts: 27
Member Since:
26 January, 2013
sp_UserOfflineSmall Offline

So I still found one more thing to translate. But I couldn't see the name on the drop-down filter code like those earlier. Drop down menu's "Sort by" has "passage" as option. Where do I find that to add it to the .po file?

11 March, 2013
6:13 am
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

Tsuua, just add the following three lines to your sermon-browser-xx_XX.po file:

http://pastebin.com/RxeCchjX

On the third line (msgstr), put your translated word for "Passage" in the quotes.

Compile the .mo file, and upload both the .po and .mo files to the sb-includes folder.

That should do it.  Let me know if you run into any trouble.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

Forum Timezone: Europe/London

Most Users Ever Online: 381

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Rich Brown: 358

Matt Schlueter: 93

Mindy: 72

Don Johnson: 65

anointed: 57

0be1: 55

Member Stats:

Guest Posters: 7

Members: 3188

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 2

Topics: 1713

Posts: 7499

Newest Members:

marktest, deatles50, ValeriaGoodriz, dapedPup, oapedPup, Margarettoimb

Moderators: Ben Miller: 1628

Administrators: Mark Barnes: 435