Ticket #6101: webwatchLocalization.patch

File webwatchLocalization.patch, 14.2 KB (added by Karvjorm, 10 years ago)

A localization patch for Webwatch

  • src/apps/webwatch/readme.html

     
    1 <HTML>
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    24
    3 <HEAD>
    4 <TITLE>WebWatch</TITLE>
    5 </HEAD>
     5<head>
     6<title>WebWatch</title>
     7<meta http-equiv="content-type" content="text/html;charset=utf-8" />
     8</head>
    69
    7 <BODY BGCOLOR="#FFFFFF">
     10<body style="background-color:#FFFFFF;">
    811
    9 <H1>WebWatch 1.5</H1>
     12<h1>WebWatch 1.5</h1>
    1013
    11 <P>Released on Thursday, 13 February 2003<BR>
    12 Created by <A HREF="mailto:mahlzeit@users.sourceforge.net">Matthijs
    13 Hollemans</A></P>
     14<p>Released on Thursday, 13 February 2003<br />
     15Created by <a href="mailto:mahlzeit@users.sourceforge.net">Matthijs
     16Hollemans</a></p>
    1417
    15 <H3>What is it</H3>
     18<h3>What is it</h3>
    1619
    17 <P>WebWatch is an unofficial port of Swatch's Internet Time utility for BeOS
    18 R5 or higher that runs inside the Deskbar.</P>
     20<p>WebWatch is an unofficial port of Swatch's Internet Time utility for BeOS
     21R5 or higher that runs inside the Deskbar.</p>
    1922
    20 <P>Someone at Swatch (you know, the company that makes the watches) came up
     23<p>Someone at Swatch (you know, the company that makes the watches) came up
    2124with an idea for a universal time format that eliminates time zones and
    2225geographical borders. The idea is very simple: time is no longer measured in
    2326hours, minutes, and seconds, but in "beats." A single day consists of 1000
    24 beats, so each beat corresponds to 1 minute and 26.4 seconds.</P>
     27beats, so each beat corresponds to 1 minute and 26.4 seconds.</p>
    2528
    26 <P>This "Internet Time" is the same all over the world, because it is measured
     29<p>This &quot;Internet Time&quot; is the same all over the world, because it is measured
    2730relatively to something called the Biel Mean Time (BMT), a new meridian that
    2831lies in Switzerland. A day in Internet Time begins at midnight BMT, or @000
    2932Swatch Beats, 12 noon is equivalent to @500 beats, and so on. So if it's @812
    30 at my place, it's also 812 beats at yours and everyone else's.</P>
     33at my place, it's also 812 beats at yours and everyone else's.</p>
    3134
    32 <P>Please check out the <A HREF="http://www.swatch.com">Swatch website</A>
    33 for more information.</P>
     35<p>Please check out the <a href="http://www.swatch.com">Swatch website</a>
     36for more information.</p>
    3437
    35 <H3>How to use it</H3>
     38<h3>How to use it</h3>
    3639
    37 <P>Simply double-click the WebWatch icon to install WebWatch into the Deskbar.
    38 To get rid of it, right-click <CODE>WebWatch</CODE> in the Deskbar and select
    39 the <CODE>Quit</CODE> option from the pop-up menu.</P>
     40<p>Simply double-click the WebWatch icon to install WebWatch into the Deskbar.
     41To get rid of it, right-click <code>WebWatch</code> in the Deskbar and select
     42the <code>Quit</code> option from the pop-up menu.</p>
    4043
    41 <H3>Legal stuff</H3>
     44<h3>Legal stuff</h3>
    4245
    43 <P>This version of WebWatch is open source and may be distributed under the
     46<p>This version of WebWatch is open source and may be distributed under the
    4447terms of the MIT license. Note that the author is in no way affiliated with
    45 Swatch, and fully respects their copyrights and trademarks.</P>
     48Swatch, and fully respects their copyrights and trademarks.</p>
    4649
    47 <P>Copyright (c) 1999-2003 Matthijs Hollemans</P>
     50<p>Copyright &copy; 1999-2003 Matthijs Hollemans</p>
    4851
    49 <P>Permission is hereby granted, free of charge, to any person obtaining a
    50 copy of this software and associated documentation files (the "Software"),
     52<p>Permission is hereby granted, free of charge, to any person obtaining a
     53copy of this software and associated documentation files (the &quot;Software&quot;),
    5154to deal in the Software without restriction, including without limitation
    5255the rights to use, copy, modify, merge, publish, distribute, sublicense,
    5356and/or sell copies of the Software, and to permit persons to whom the
    54 Software is furnished to do so, subject to the following conditions:</P>
     57Software is furnished to do so, subject to the following conditions:</p>
    5558 
    56 <P>The above copyright notice and this permission notice shall be included in
    57 all copies or substantial portions of the Software.</P>
     59<p>The above copyright notice and this permission notice shall be included in
     60all copies or substantial portions of the Software.</p>
    5861 
    59 <P>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     62<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    6063IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    6164FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    6265AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    6366LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    6467FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    65 DEALINGS IN THE SOFTWARE.</P>
     68DEALINGS IN THE SOFTWARE.</p>
    6669
    67 <H3>History</H3>
     70<h3>History</h3>
    6871
    69 <P><I>Version 1.5 (Thursday, 13 February 2003)</I></P>
     72<p><i>Version 1.5 (Thursday, 13 February 2003)</i></p>
    7073
    71 <UL>
    72 <LI>Cleaned up the source code.</LI>
    73 <LI>Now uses the plain font, not the bold font.</LI>
    74 </UL>
     74<ul>
     75<li>Cleaned up the source code.</li>
     76<li>Now uses the plain font, not the bold font.</li>
     77</ul>
    7578
    76 <P><I>Version 1.4 (Saturday, 9 December 2000)</I></P>
     79<p><i>Version 1.4 (Saturday, 9 December 2000)</i></p>
    7780
    78 <UL>
    79 <LI>With certain fonts, WebWatch didn't always fit in the Deskbar.</LI>
    80 </UL>
     81<ul>
     82<li>With certain fonts, WebWatch didn't always fit in the Deskbar.</li>
     83</ul>
    8184
    82 <P><I>Version 1.3 (Sunday, 26 November 2000)</I></P>
     85<p><i>Version 1.3 (Sunday, 26 November 2000)</i></p>
    8386
    84 <UL>
    85 <LI>The time is now written using a bold font, making it better readable.</LI>
    86 <LI>Thanks to Jason Parks for turning WebWatch into a real Deskbar add-on.
     87<ul>
     88<li>The time is now written using a bold font, making it better readable.</li>
     89<li>Thanks to Jason Parks for turning WebWatch into a real Deskbar add-on.
    8790Because of this, WebWatch no longer needs to be installed in the
    8891UserBootscript; the Deskbar starts it automatically. This also means that
    89 WebWatch is now BeOS R5 or higher only.</LI>
    90 </UL>
     92WebWatch is now BeOS R5 or higher only.</li>
     93</ul>
    9194
    92 <P><I>Version 1.2 (Tuesday, 26 September 2000)</I></P>
     95<p><i>Version 1.2 (Tuesday, 26 September 2000)</i></p>
    9396
    94 <UL>
    95 <LI>Finally fixed a long-standing bug with WebWatch's background color. Now it
    96 uses the same color as the Deskbar.</LI>
    97 </UL>
     97<ul>
     98<li>Finally fixed a long-standing bug with WebWatch's background color. Now it
     99uses the same color as the Deskbar.</li>
     100</ul>
    98101
    99 <P><I>Version 1.1 (Tuesday, 28 March 2000)</I></P>
     102<p><i>Version 1.1 (Tuesday, 28 March 2000)</i></p>
    100103
    101 <UL>
    102 <LI>New release for BeOS R5. Older versions of WebWatch came with source
     104<ul>
     105<li>New release for BeOS R5. Older versions of WebWatch came with source
    103106code only, which was automatically compiled during installation. However,
    104107because of header file changes between R5 and older versions of the BeOS,
    105108and because the free version of BeOS R5 doesn't necessarily include
    106109development tools, WebWatch 1.1 is already compiled. This means that it
    107 only runs on the Intel platform, since I don't have a PowerPC machine.</LI>
    108 </UL>
     110only runs on the Intel platform, since I don't have a PowerPC machine.</li>
     111</ul>
    109112
    110 <P><I>Version 1.0 (Saturday, 14 August 1999)</I></P>
     113<p><i>Version 1.0 (Saturday, 14 August 1999)</i></p>
    111114
    112 <UL>
    113 <LI>First version.</LI>
    114 </UL>
     115<ul>
     116<li>First version.</li>
     117</ul>
    115118
    116 </BODY>
    117 </HTML>
     119<p>
     120    <a href="http://validator.w3.org/check?uri=referer"><img
     121        src="http://www.w3.org/Icons/valid-xhtml10"
     122        alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
     123</p>
     124
     125</body>
     126</html>
  • src/apps/webwatch/WatchView.cpp

     
    3030#include "WatchApp.h"
    3131#include "WatchView.h"
    3232
     33#undef B_TRANSLATE_CONTEXT
     34#define B_TRANSLATE_CONTEXT "WatchView"
     35
     36
    3337const rgb_color COLOR_FOREGROUND = { 0, 0, 0 };
    3438
    35 ////////////////////////////////////////////////////////////////////////////////
     39///////////////////////////////////////////////////////////////////////////////
    3640
    3741WatchView::WatchView()
    38     : BView(BRect(0, 0, 1, 1), 0, 0, 0)
     42    :
     43    BView(BRect(0, 0, 1, 1), 0, 0, 0),
     44    fAppCatalog(NULL)
    3945{
    40     // Do nothing.
     46    be_locale->GetAppCatalog(&fAppCatalog);
    4147}
    4248
    43 ////////////////////////////////////////////////////////////////////////////////
     49///////////////////////////////////////////////////////////////////////////////
    4450
    4551WatchView::WatchView(BMessage* message)
    4652    : BView(
     
    6268    SetViewColor(B_TRANSPARENT_COLOR);
    6369}
    6470
    65 ////////////////////////////////////////////////////////////////////////////////
     71///////////////////////////////////////////////////////////////////////////////
    6672
    6773__declspec(dllexport) WatchView* WatchView::Instantiate(BMessage* archive)
    6874{
     
    7480    return NULL;
    7581}
    7682
    77 ////////////////////////////////////////////////////////////////////////////////
     83///////////////////////////////////////////////////////////////////////////////
    7884
    7985status_t WatchView::Archive(BMessage* archive, bool deep) const
    8086{
     
    8692    return B_OK;
    8793}
    8894
    89 ////////////////////////////////////////////////////////////////////////////////
     95///////////////////////////////////////////////////////////////////////////////
    9096
    9197void WatchView::Draw(BRect updateRect)
    9298{
     
    112118    DrawString(string, BPoint(x, y));
    113119}
    114120
    115 ////////////////////////////////////////////////////////////////////////////////
     121///////////////////////////////////////////////////////////////////////////////
    116122
    117123void WatchView::MouseDown(BPoint point)
    118124{
    119     BPopUpMenu* menu = new BPopUpMenu("WatchView", false, false);
     125    BPopUpMenu* menu = new BPopUpMenu(B_TRANSLATE("WatchView"), false, false);
    120126
    121127    menu->AddItem(new BMenuItem(
    122         "About" B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED)));
     128        B_TRANSLATE("About" B_UTF8_ELLIPSIS),
     129        new BMessage(B_ABOUT_REQUESTED)));
    123130
    124131    menu->AddItem(new BMenuItem(
    125         "Quit", new BMessage(B_QUIT_REQUESTED)));
     132        B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED)));
    126133
    127134    menu->SetTargetForItems(this);
    128135
     
    132139    delete menu;
    133140}
    134141
    135 ////////////////////////////////////////////////////////////////////////////////
     142///////////////////////////////////////////////////////////////////////////////
    136143
    137144void WatchView::MessageReceived(BMessage* msg)
    138145{
     
    144151    }
    145152}
    146153
    147 ////////////////////////////////////////////////////////////////////////////////
     154///////////////////////////////////////////////////////////////////////////////
    148155
    149156void WatchView::OnAboutRequested()
    150157{
    151     (new BAlert(
    152         NULL,
    153         "WebWatch " VERSION
     158    BString text = B_TRANSLATE("WebWatch %1"
    154159        "\nAn internet time clock for your Deskbar\n\n"
    155160        "Created by Matthijs Hollemans\n"
    156161        "mahlzeit@users.sourceforge.net\n\n"
    157         "Thanks to Jason Parks for his help.\n",
    158         "OK"))->Go(NULL);
     162        "Thanks to Jason Parks for his help.\n");
     163    text.ReplaceFirst("%1", VERSION);
     164    (new BAlert(NULL, text.String(), B_TRANSLATE("OK")))->Go(NULL);
    159165}
    160166
    161 ////////////////////////////////////////////////////////////////////////////////
     167///////////////////////////////////////////////////////////////////////////////
    162168
    163169void WatchView::OnQuitRequested()
    164170{
     
    171177    deskbar.RemoveItem(DESKBAR_ITEM_NAME);
    172178}
    173179
    174 ////////////////////////////////////////////////////////////////////////////////
     180///////////////////////////////////////////////////////////////////////////////
    175181
    176182void WatchView::Pulse()
    177183{
     
    183189    }
    184190}
    185191
    186 ////////////////////////////////////////////////////////////////////////////////
     192///////////////////////////////////////////////////////////////////////////////
    187193
    188194int32 WatchView::GetInternetTime()
    189195{
     
    196202    return (int32) (((real_time_clock() + 3600) % 86400) / 86.4);
    197203}
    198204
    199 ////////////////////////////////////////////////////////////////////////////////
     205///////////////////////////////////////////////////////////////////////////////
  • src/apps/webwatch/Jamfile

     
    1010Application WebWatch :
    1111    WatchApp.cpp
    1212    WatchView.cpp
    13     : be $(TARGET_LIBSUPC++)
     13    : be locale $(TARGET_LIBSUPC++)
    1414    : WebWatch.rdef
    1515;
    1616
     17DoCatalogs WebWatch :
     18    x-vnd.mahlzeit.webwatch
     19    :
     20    WatchView.cpp
     21;
  • src/apps/webwatch/WatchView.h

     
    2323#ifndef WATCHVIEW_H
    2424#define WATCHVIEW_H
    2525
     26#include <Catalog.h>
     27#include <Locale.h>
    2628#include <View.h>
    2729
    2830class WatchView : public BView
     
    6870   
    6971    // The Internet Time from the last call to Pulse().
    7072    int32 oldTime;
     73    BCatalog fAppCatalog;
    7174};
    7275
    7376#endif // WATCHVIEW_H
  • src/apps/webwatch/WatchApp.cpp

     
    2626#include "WatchApp.h"
    2727#include "WatchView.h"
    2828
    29 ////////////////////////////////////////////////////////////////////////////////
     29///////////////////////////////////////////////////////////////////////////////
    3030
    3131BView* instantiate_deskbar_item()
    3232{
    3333    return new WatchView;
    3434}
    3535
    36 ////////////////////////////////////////////////////////////////////////////////
     36///////////////////////////////////////////////////////////////////////////////
    3737
    3838WatchApp::WatchApp() : BApplication(APP_SIGNATURE)
    3939{
     
    5454    PostMessage(B_QUIT_REQUESTED);
    5555}
    5656
    57 ////////////////////////////////////////////////////////////////////////////////
     57///////////////////////////////////////////////////////////////////////////////
    5858
    5959int main()
    6060{
     
    6363    return 0;
    6464}
    6565
    66 ////////////////////////////////////////////////////////////////////////////////
     66///////////////////////////////////////////////////////////////////////////////