Page Index Toggle Pages: 1 ReplyAdd Poll Send Topic
Hot Topic (More than 10 Replies) "downloads" can be translated two ways (Read 6973 times)
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
"downloads" can be translated two ways
Jul 20th, 2014 at 12:50pm
Mark & QuoteQuote  
Code
Select All
 Index: cgi-bin/yabb2/Languages/English/FA.lng
 ===================================================================
 --- cgi-bin/yabb2/Languages/English/FA.lng	(revision 1513)
 +++ cgi-bin/yabb2/Languages/English/FA.lng	(working copy)
 @@ -89,6 +89,7 @@
  '41' => 'File Size',
  '41a' => 'Downloads',
  '41b' => 'Download',
 +'41c' => 'Downloads', # n downloads
  '42' => 'Posted By',
  '42a' => 'Attached By',
  '43' => 'Date',
 Index: cgi-bin/yabb2/Sources/Display.pm
 ===================================================================
 --- cgi-bin/yabb2/Sources/Display.pm	(revision 1513)
 +++ cgi-bin/yabb2/Sources/Display.pm	(working copy)
 @@ -870,7 +870,7 @@
                  my $filesize = -s "$uploaddir/$_";
                  $urlname = $_;
                  $urlname =~ s/([^A-Za-z0-9])/sprintf('%%%02X', ord($1))/egxsm;
 -                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'};
 +                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41c'};
                  if ($filesize) {
                      if (   $_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ixsm
                          && $amdisplaypics == 1 )
 Index: cgi-bin/yabb2/Sources/Printpage.pm
 ===================================================================
 --- cgi-bin/yabb2/Sources/Printpage.pm	(revision 1513)
 +++ cgi-bin/yabb2/Sources/Printpage.pm	(working copy)
 @@ -676,7 +676,7 @@
                        : "$micon_bg{'paperclip'}";
                  }
                  my $filesize = -s "$uploaddir/$_";
 -                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'};
 +                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41c'};
                  if ($filesize) {
                      if (   $_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ixsm
                          && $amdisplaypics == 1 )
  

  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: "downloads" can be translated two ways
Reply #1 - Jul 20th, 2014 at 1:55pm
Mark & QuoteQuote  
If we make it (as a mod in this case)

Code (Perl)
Select All
if ($fatxt{'41c'}) {$fatxt{'41a'} = $fatxt{'41c'};}
 $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'}; 



That way other languages that don't need it won't be affected.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: "downloads" can be translated two ways
Reply #2 - Jul 20th, 2014 at 1:59pm
Mark & QuoteQuote  
Dandello wrote on Jul 20th, 2014 at 1:55pm:
If we make it (as a mod in this case)

Code (Perl)
Select All
if ($fatxt{'41c'}) {$fatxt{'41a'} = $fatxt{'41c'};}
 $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'}; 



That way other languages that don't need it won't be affected.


Overwriting variables at run-time is something I try to avoid... Can cause weird bugs that are hard to trace...

Instead you should try something like this:

Code
Select All
 $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : (($fatxt{'41c'}) ? $fatxt{'41c'} : $fatxt{'41a'});
  

  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: "downloads" can be translated two ways
Reply #3 - Jul 20th, 2014 at 3:01pm
Mark & QuoteQuote  
This is why it's good to have more than one coder onboard. Grin
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: "downloads" can be translated two ways
Reply #4 - Jul 20th, 2014 at 4:53pm
Mark & QuoteQuote  
Dandello wrote on Jul 20th, 2014 at 3:01pm:
This is why it's good to have more than one coder onboard. Grin

I'm not a coder, I'm a hacker... That's a difference...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: "downloads" can be translated two ways
Reply #5 - Jul 20th, 2014 at 5:19pm
Mark & QuoteQuote  
Monni wrote on Jul 20th, 2014 at 4:53pm:
I'm not a coder, I'm a hacker... That's a difference...
                     


This is Perl - we're all hackers.  Grin
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: "downloads" can be translated two ways
Reply #6 - Jul 20th, 2014 at 5:30pm
Mark & QuoteQuote  
Dandello wrote on Jul 20th, 2014 at 5:19pm:
Monni wrote on Jul 20th, 2014 at 4:53pm:
I'm not a coder, I'm a hacker... That's a difference...
                   


This is Perl - we're all hackers.  Grin


lol... the forum logged me out in middle of reply...

Eh... I thought this was Perl code that outputs JavaScript and html... Just like I used to also write TCL code that did output PHP code that did output... eh...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: "downloads" can be translated two ways
Reply #7 - Jul 20th, 2014 at 5:49pm
Mark & QuoteQuote  
YaBB has the distinction of being one of the first Perl software forum packages (if not THE first Perl software forum package) that uses a framework. (Which outputs html and javascript. And one of the issues JonB has been having in getting the BoardMod.org code to work is that IT was outputting some sections to PHP.)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: "downloads" can be translated two ways
Reply #8 - Jul 20th, 2014 at 5:58pm
Mark & QuoteQuote  
Dandello wrote on Jul 20th, 2014 at 5:49pm:
YaBB has the distinction of being one of the first Perl software forum packages (if not THE first Perl software forum package) that uses a framework. (Which outputs html and javascript. And one of the issues JonB has been having in getting the BoardMod.org code to work is that IT was outputting some sections to PHP.)


The first Perl code ever I was working on was SMB2WWW... For some weird reason I decided I wanted it to be internationalized Smiley Since then I have been working on internationalization projects...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: "downloads" can be translated two ways
Reply #9 - Jul 20th, 2014 at 7:17pm
Mark & QuoteQuote  
Monni wrote on Jul 20th, 2014 at 5:58pm:
Since then I have been working on internationalization projects...


Keep up the good work.  Smiley
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: "downloads" can be translated two ways
Reply #10 - Aug 31st, 2014 at 10:35am
Mark & QuoteQuote  
Using the new isempty():

Code
Select All
 Index: cgi-bin/yabb2/Sources/Display.pm
 ===================================================================
 --- cgi-bin/yabb2/Sources/Display.pm	(revision 1557)
 +++ cgi-bin/yabb2/Sources/Display.pm	(working copy)
 @@ -870,7 +870,7 @@
                  my $filesize = -s "$uploaddir/$_";
                  $urlname = $_;
                  $urlname =~ s/([^A-Za-z0-9])/sprintf('%%%02X', ord($1))/egxsm;
 -                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'};
 +                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : isempty( $fatxt{'41c'}, $fatxt{'41a'} );
                  if ($filesize) {
                      if (   $_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ixsm
                          && $amdisplaypics == 1 )
 Index: cgi-bin/yabb2/Sources/Printpage.pm
 ===================================================================
 --- cgi-bin/yabb2/Sources/Printpage.pm	(revision 1557)
 +++ cgi-bin/yabb2/Sources/Printpage.pm	(working copy)
 @@ -676,7 +676,7 @@
                        : "$micon_bg{'paperclip'}";
                  }
                  my $filesize = -s "$uploaddir/$_";
 -                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : $fatxt{'41a'};
 +                $download_txt = ( $attach_count{$_} == 1 ) ? $fatxt{'41b'} : isempty( $fatxt{'41c'}, $fatxt{'41a'} );
                  if ($filesize) {
                      if (   $_ =~ /\.(bmp|jpe|jpg|jpeg|gif|png)$/ixsm
                          && $amdisplaypics == 1 )
  

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
"downloads" can be translated two ways

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry