From: Kaj-Michael Lang Date: Wed, 25 Jul 2007 11:37:05 +0000 (+0300) Subject: Remove some more generated files X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15a46ab0ccc94b8b157000a6fdcd0413fcd33a16;p=mapper Remove some more generated files --- diff --git a/data/help/en_US/maemomapper.xml b/data/help/en_US/maemomapper.xml deleted file mode 100644 index 263e6c4..0000000 --- a/data/help/en_US/maemomapper.xml +++ /dev/null @@ -1,1234 +0,0 @@ - - - - Maemo Mapper - - Introduction - - Welcome to Maemo Mapper. - - Maemo Mapper is a geographical mapping tool that can be used to: - - - - Download map data to your device's main memory or to an external - memory card. - - - View that map data on the screen. - - - Navigate that map data by panning around the screen and zooming in - and out. - - - Display your position and other GPS information from a GPS - receiver. - - - Store and display Point-of-Interest (POI) data. - - - Download directions between arbitrary points on the map. - - - Save or open track data or route data. - - - - Use the to peruse the - various sections of this help document, or go to to - get up and running quickly. - - - - Getting Started - - - When you first start Maemo Mapper, you will be presented with the - Settings dialog box. Most of the - settings have reasonable defaults, but if you have a GPS receiver, - you should fill in the MAC field with - the MAC address of your GPS receiver. If you don't know the MAC, - turn on your GPS receiver and push the - Search button. Maemo Mapper will - attempt to automatically discover the MAC address of your receiver. - For more information about the Settings - dialog box, see . - - - When you are finished setting up Maemo Mapper to your preferences, - pressing the Ok button will lead you to - another dialog box: the Manage - Repositories dialog. - - - To get started quickly, press the - Download... button. Maemo Mapper will - download a set of pre-defined repository information for you to use. - If you use the pre-defined repositories, you can delete the - Default repository. For more - information about repositories and the Manage - Repositories dialog, see - . - - - Certain repositories (most notably, the commercial ones) may have - license agreements attached with their use. It may be illegal to - use a certain repository with Maemo Mapper or under certain - conditions. This includes the repositories downloaded via the - Download... button. If you are not - sure if you are legally allowed to use a particular repository, you - should delete it from your list of repositories. The authors of - Maemo Mapper cannot be held responsible for your use of a particular - repository. - - - Once you have your Repositories set up the way you like, press the - Ok button, and you will be presented with a blank screen, because - you have not yet actually downloaded any map data to your device. - To allow Maemo Mapper to automatically download map data as it - becomes needed on the display, enable the - Auto-Download checkbox in the - Maps menu. - - - If you have a working internet connection, Maemo Mapper will attempt - to download maps and display them on the screen automatically as - the downloads complete. You should see a map of the world. Be - careful when you enable Auto-Download, because it can quickly fill - your available disk space. See - for - details on how to manage disk space for a particular repository. - - The Graphical User Interface - - The main view of Maemo Mapper emphasizes simplicity. By default, - the map is all that is displayed. You current position (if you have - a GPS receiver) is indicated by a blue circle. The blue line - extending from the blue circle indicates your current heading and - speed. Tracks are red and represent where you have been. - Routes are green and represent where you want to go, i.e. - directions to a location. - - - The hardware buttons on your device provide quick access to common - functionality: - - - - - Toggle - Full-Screen Mode - - - - Zoom In - hold down to - zoom multiple levels at a time - - - - Zoom Out - hold down to - zoom multiple levels at a time - - - - Pan Up - hold down to - scroll - - - - Pan Down - hold down - to scroll - - - - Pan Left - hold down - to scroll - - - - Pan Right - hold down - to scroll - - - - Toggle - - - - - Programmable; defaults - to: Hide/Show Tracks and Routes - - - - You can also pan around the map by tapping on the screen. Maemo - Mapper will center the display on where you tapped. If you had - Auto-Center enabled, tapping a location - to center on it will automatically disable that functionality. - - - From this point, you can use the menus to manage routes, tracks, and - map data; to change the view; to change settings; or to see detailed - GPS information (if you have a GPS receiver). - - - There is also a context-sensitive menu that appears on the map when - you tap and hold a location on the map. From that menu, you can - download directions, calculate distances, or add/modify - Point-of-Interest (POI) data. - - - For help with any of these features, use the - . - - - - Main Menu - - - This help topic describes the functionality of each of the menu - items in Maemo Mapper. - - Route - - The Route menu is used to manipulate - the current route. A route in Maemo Mapper is defined as a - set of points and waypoints describing where you would like to - go, e.g. driving directions from 123 Main Street to 456 Elm - Street. It can include multiple segments. The current route is - empty until you open or download a route. - - - The Route menu has the following menu - items: - - - - Open... - Open a route from a GPX - file on the file system. The opened route is appended to - the current route, so you can string together different routes - together to create a trip with multiple destinations. - - - Download... - Download a route from - the internet. See for more information. - - - Save... - Save the current route to a - GPX file on the file system. - - - Show Distance to Next Waypoint - Show - the distance left to be traveled (along the current route) until - the next waypoint. - - - Show Distance to End of Route - Show - the distance left to be traveled (along the current route) until - the end of the current route. The calculated distance includes - the distance between breaks in the route (i.e. between the end of - one route segment and the beginning of another route segment). - - - Reset - Reset Maemo Mapper's tracking - of your progress along the current route. Use this if Maemo - Mapper loses track of where you are with respect to the current - route. - - - Reset - Clear the current route, - effectively replacing it with an empty route. - - - Track - - The Track menu is used to manipulate - your current track. A track in Maemo Mapper is defined as - a set of points along which you have been traveling, i.e. where - you have been. It can include multiple segments. Tracks are - most useful if you have enabled a GPS receiver. The current track - is empty until you get at least one valid position point from your - GPS receiver, and it is appendeded to whenever you stray far enough - from the last track point. - - - The Track menu has the following menu - items: - - - - Open... - Open a track from a GPX - file on the file system. In contrast to route data, the opened - track is prepended to the current track, so if you are - trying to rebuild previous track data, you must open the tracks - backward in time (most recent tracks first). - - - Save... - Save the current track to a - GPX file on the file system. - - - Insert Break - Artificially insert a - break in your current track data. This simulates the loss and - re-acquisition of a GPS fix, and it can be used to track, for - example, refueling stops. - - - Insert Mark - Artificially insert a - mark with a description in your current track data. This can be - used to mark important landmarks. - - - Show Distance from Last Break - Show - the distance traveled (along the current track) since the last - break. - - - Show Distance from Beginning - Show - the distance traveled (along the current track) since the - beginning of the track. The calculated distance includes the - distance between breaks in the track (i.e. between when a GPS fix - is lost and later re-acquired). - - - Clear - Clear the current track, - effectively replacing it with an empty track. - - - Maps - - The Maps menu is used to control your - map repositories. This menu will be populated with a list of all of - your map repositories, from which you can select to switch to a - particular repository. - - - The Maps menu has the following menu - items in addition to the list of available repositories: - - - - Manage Maps... - Download or delete - maps for the currently selected repository. For more details, see - . - - - Manage Repositories... - Configure - each of your available repositories, or add new ones. You can - also download a pre-defined set of repositories. For more - details, see . - - - Auto-Download - Toggle Maemo Mapper's - ability to automatically download maps as they are needed in order - to fill the screen with map data. This is useful for arbitrary - exploration of the world while connected to the internet, or if - you have a constant connection to the internet (i.e. via a - cellular data service). - - - View - - The View menu allows you to customize - the view by showing or hiding certain features of the display. - - - The View menu has the following menu - items: - - - - Zoom In - Zoom in by one zoom level. - You can also use the button. - - - Zoom Out - Zoom out by one zoom - level. You can also use the button. - - - Full Screen - Toggle full-screen - mode. You can also use the button to toggle - full-screen mode. - - - Scale - Toggle the display of the - scale. - - - Route - Toggle the display of routes. - - - Track - Toggle the display of tracks. - - - Velocity Vector - Toggle the display - of the velocity vector (the blue line extending from the blue - circle that represents your current location). - - - POIs - Toggle the display of POIs. - - - POI Categories... - Define POI - categories and which categories are displayed on the map. For - more details, see . - - - Auto-Center - - The Auto-Center menu is used to control - whether or not Maemo Mapper should re-center the display as your - current location changes. The sensitivity of re-centering (how - close you get to the edge of the display before Maemo Mapper - re-centers the display) can be configured in the Dialog. - - - There are three different modes of Auto-Center: - - - - Lat/Lon - Keep your location centered - on the display. - - - Lead - Depending on your speed, keep - a location in front of you centered on the screen. The faster you - are going, the more lead distance is used. - - - None - Do no re-center the display - automatically. - - - Go to - - The Go to menu is used to center the - view on a particular location. - - - The Go to menu has the following menu - items: - - - - Lat/Lon... - Specify an exact - Latitude and Longitude on which to center the display. - - - GPS Position - Center the display on - your current GPS position. This is the manual counter-part of - the Auto-Center functionality - mentioned above. - - - Next Waypoint - Center the display on - the next waypoint in your route. By default, the next waypoint is - colored a slightly darker green than normal waypoints. - - - Nearest POI - Center the display on - the enabled POI nearest to the current view center. - - - GPS - - The GPS menu is used to access features - of the GPS receiver, including textual information not displayed on - the map. It is also used to control your connection to the GPS - receiver. - - - - Enable GPS - Toggle communication - with a GPS receiver. You must have a GPS receiver set up in order - to use this menu item. When on, Maemo Mapper will constantly - search for the GPS receiver. - - - Show Information - Toggle display of - additional information provided by the GPS receiver. This - information will appear in the main display as a panel on the - left. - - - Details... - Show even more - information provided by the GPS receiver, including a polar plot - of all GPS satellites in view. - - - Reset Bluetooth - Attempt to reset - the bluetooth radio, in case it locks up for some reason. In - order for this to succeed, you must add the following line - to your /etc/sudoers file (if you don't know what that means, - don't try it): user ALL = NOPASSWD: /usr/sbin/hciconfig hci0 - reset - - - Other - - In addition to the above menus, there are a few other items in the - main menu: - - - - Settings... - Access and change - settings for using Maemo Mapper. For more information, see . - - - Help... - Access this help file. - - - About... - Display version and - copyright information. - - - Close - Close Maemo Mapper. - - - - - Context Menu - - - By tapping and holding on the screen, you can access the context - menu to execute actions on either that location, the nearest route - waypoint, or the nearest POI. - - - The context menu is separated into two hierarchical levels. The - first level (Location, - Waypoint, or - POI) determines what kind of data on - which the operation applies. - - Location - - The Location submenu performs actions - on the exactly latitude and longitude on which the tap-and-hold - operation was performed. With that location, you can do the - following actions: - - - - Show Lat/Lon - Display the latitude - and longitude of the selected location, in the style chosen in - Settings - - - Copy Lat/Lon - Copy the latitude and - longitude of the selected location to the clipboard, in - comma-separated decimal format. - - - Show Distance to - Display the - distance (in a straight line) to the selected location. - - - Download Route to... - Open the - dialog with the selected location - pre-filled as the destination. - - - Add Route Point - Add a point to the - current route, based on the selected location. The point is not a - waypoint. - - - Add Waypoint... - Add a waypoint - to the current route, based on the selected location. You must - provide a description for the waypoint to be legitimate. By - specifying an empty description, however, you can create a break - in the route. The break will not be connected to the rest of the - route, so it can be used to start a new segment. - - - Add POI... - Add a POI to the POI - database, based on the selected location. If the category in - which you place the POI is disabled, it will not be visible on the - map after creation, but it will still be in the database. - - - Set as GPS Position - Force Maemo - Mapper to consider the selected location to be the current GPS - location. This will not affect the current track, but it will - change the location of the blue circle that represents your - current location, and it can be used to calculate a route from - that location. - - - Waypoint - - The Waypoint submenu performs actions - on the waypoint nearest to the point on which the tap-and-hold - operation was performed. If no waypoints are nearby, an error - message will be displayed. - - - - Show Lat/Lon - Show the latitude and - longitude of the selected waypoint, in the style chosen in - Settings. - - - Show Description - Show the - description attached to the select waypoint. When downloading - routes via the dialog, the description will contain - the directions needed to take at that waypoint (e.g. "Turn left at - Main Street. Go 2.5 kilometers."). - - - Copy Lat/Lon - Copy the latitude and - longitude of the selected waypoint to the clipboard, in - comma-separated decimal format. - - - Copy Description - Copy the - description of the waypoint to the clipboard. - - - Show Distance to - Show the distance - left to be traveled (along the current route) until the selected - waypoint. The calculated distance includes the distance between - breaks in the route (i.e. between the end of one route segment and - the beginning of another route segment). - - - Download Route to... - Open the - dialog with the selected waypoint's - location pre-filled as the destination. - - - Delete... - Delete the selected - waypoint from the current route. This will delete all route - segments surrounding the route, including (and limited to) all the - points from that waypoint to the next and previous waypoints. - - - Add POI... - Add a POI to the POI - database, based on the selected waypoint's location. If the - category in which you place the POI is disabled, it will not be - visible on the map after creation, but it will still be in the - database. - - - POI - - The POI submenu performs actions - on the POI nearest to the point on which the tap-and-hold operation - was performed. If no POIs are nearby, an error message will be - displayed. - - - - View/Edit - View and/or edit the - selected POI. - - - Show Distance to - Display the - distance (in a straight line) to the selected POI. - - - Download Route to... - Open the - dialog with the selected POI's - location pre-filled as the destination. - - - Add Route Point - Add a point to the - current route, based on the selected POI's location. The point is - not a waypoint. - - - Add Waypoint... - Add a waypoint - to the current route, based on the selected location. You must - provide a description for the waypoint to be legitimate. By - specifying an empty description, however, you can create a break - in the route. The break will not be connected to the rest of the - route, so it can be used to start a new segment. - - - - - Managing Repositories - - - In Maemo Mapper, map data is divided into specific areas called - repositories. A repository is a source of map data, each of - which has its own way of visualizing the Earth. For example, - repositories based on street maps typically draw roads as lines and - buildings as areas, whereas repositories based on satellite data - draw the Earth as it would appear from space. There are also - "hybrid" repositories that overlay street map data on top of - satellite data, as well as topographical maps that show altitude - data. - - - Each repository is made up of maps at 16 different zoom levels. - Zoom Level 0 is the highest resolution (closest to the Earth, i.e. - "zoomed in"), and Zoom Level 15 is the lowest resolution (furthest - from the Earth, i.e. "zoomed out"). Not all repositories are - available at all zoom levels, and some repositories may even produce - an error (which you can ignore) if you try to download maps at that - zoom level. - - - Once you have set up at least one repository, you can start - downloading maps from that repository to your device's file system. - For details on how to do this, see - . - - - You can set up any number of repositories in Maemo Mapper, but only - one can be active at any given time. The Manage - Repositories dialog is accessed via the - Manage Repositories... menu item of the - Maps menu, and it allows you to add, - edit, and remove repositories. - - - The Manage Repositories... has a combo - box that controls which repository is being viewed and edited. When - a repository is selected, the controls below it display the current - settings, which you can change: - - - - URL Format - A specially formatted - string that looks like a URL, but it needs to have at least one - printf-style substitution strings (like %f or %s). Normally, you - must either get these URL formats from the internet - (www.internettablettalk.com is a good source), or you can use the - Download... button in the - Repositories dialog box to download a sample. - - - Cache Dir. - A directory on the file - system (either on the device's internal memory, or an external - memory card) in which maps are stored. Maps are kept here - indefinitely (until you delete them), so pick a directory with a - lot of free space. You can use the - Browse... button to select the - directory with a graphical file system browser, or you can enter - the directory manually. - - - Download Zoom Steps - Controls which - zoom levels should be avoided when automatically downloading maps - (i.e. Auto-Download is enabled). The lowest setting (one bar) - means to download every zoom level. The highest setting (four - bars) causes Maemo Mapper to only download every fourth zoom level - (0, 4, 8, and 16). - - - View Zoom Steps - Similar to the - above-described Download Zoom Steps - option, except that it controls how Maemo Mapper behaves when - zooming. For example, at two bars, pressing - causes Maemo Mapper to zoom - in two levels instead of just one. Setting this equal to - Download Zoom Steps ensures that you - see all maps at their native resolution. - - - Double Pixels - This forces Maemo - Mapper to avoid using the native resolution of any maps, instead - using pixel-doubling. This is useful if your repository's maps - contain small, hard-to-read text, and you want to double the size - of the images to make them more readable. This setting can also - affect the zoom levels that are downloaded when Auto-Download is - enabled. - - - Next-able - This oddly-named option - determines whether or not the "Select Next Repository" action - (which can be mapped to any of the hardware keys) will be able to - select this repository. When unset, the "Select Next Repository" - action will simply skip over this repository. - - - - In addition to the per-repository controls, there are a few buttons - that provide additional functionality: - - - - Rename... - Renames the currently - selected repository. - - - Delete... - Deletes the currently - selected repository. - - - New... - Adds a new repository. - - - Reset... - Resets your repository - list to the factory default. This will remove all of your - repositories and replace them with the single default repository - that comes with Maemo Mapper. - - - Download... - Downloads information - about several preset repositories, and adds them to your - repository list. They will be appended to any existing - repositories you already have. They are not read-only - you may - edit them as you wish. This is a good way to get started. - - - - Certain repositories (most notably, the commercial ones) may - have license agreements attached with their use. It may be - illegal to use a certain repository with Maemo Mapper or under - certain conditions. This includes the repositories downloaded - via the Download... button. If you - are not sure if you are legally allowed to use a particular - repository, you should delete it from your list of repositories. - The authors of Maemo Mapper cannot be held responsible for your - use of a particular repository. - - - - Downloading Routes - - - Route data can be loaded from GPX files, like the ones provided by - the GPX Driving Directions web service - (http://www.gnuite.com/cgi-bin/gpx.cgi). Or, route data can be - downloaded directly within Maemo Mapper using the - Download Route dialog. - - - Downloading routes requires an active connection to the internet, - but once a route is loaded into Maemo Mapper, the internet - connection is no longer needed (unless - Auto-Update is enabled). The route - download functionality in Maemo Mapper actually uses the - aforementioned GPX Driving Directions web service. - - - The Download Route dialog contains the - following controls: - - - - Source URL - The web service from - which driving directions are retrieved. The default is fine, and - it is usually left unchanged. - - - Auto-Update - This option, only - available if Use GPS Location is - enabled, will cause Maemo Mapper to automatically re-download a - new route if you stray from the route. Note that you must have a - continuous connection to the internet (i.e. cellular data service) - for Auto-Update to work. - - - Use GPS Location - If selected, then - the current GPS location will be used as the - Origin. - - - Use End of Route - If selected, then - the end of the route will be used as the - Origin. This is useful for stringing - together multiple route downloads into a single route. - - - Origin - If selected, then you must - enter your own origin. An origin can be specified in any format - understood by Google Maps. Some examples: "25, -43" (lat/lon), - "68712" (zip code), "San Francisco, CA", "123 Main St, 45112", - "5th and Main, 12151". In fact, if your route download fails with - a "Could not generate directions" error message, you can use - Google Maps to test your origin for accuracy. - - - Destination - The destination to - which the directions will lead. Like the - Origin, a destination can be - specified in any format understood by Google Maps. - - - - - Managing Maps - - - In Maemo Mapper, repositories represent sources of map data, - and maps are just image files (e.g. PNG or JPEG) that are - drawn onto the screen. Once you have a repository set up (see - ), you can download maps from a - repository into a Map Cache, which is just a directory on your - device's file system. - - - Maemo Mapper downloads maps from the current repository so that they - can be drawn onto the screen and later recalled from disk, instead - of downloading a map every time it is needed. This is called - caching, and it allows you to use Maemo Mapper even when you - are not connected to the internet. - - - Because Maemo Mapper downloads maps to your device's file system, - you must be aware of how much disk space your maps are taking up, - especially if you enable Auto-Download. - - - Aside from the Auto-Download functionality, you can also download - maps manually using the Manage Maps... - menu item of the Maps menu. The - Manage Maps dialog allows you to - download, overwrite, or delete maps, either by area or along your - current route. It contains up to three tabs, all of which control - which and how many maps are downloaded. - - Setup - - The Setup tab controls what you what to - do. You can download maps (optionally overwriting - already-downloaded maps) from the current repository to your - device's file system, or you can delete maps (pertaining to the - current repository) from your device's file system. Both of these - operations can be done either over a rectangular area or along your - current route. - - - - Download Maps - If selected, Maemo - Mapper will download maps from the current repository to your - device's file system, for the area you specify. By default, Maemo - Mapper only downloads the maps that you don't already have. - - - Overwrite - If selected, then Maemo - Mapper will download maps and overwrite any maps that you may have - already downloaded. - - - Delete Maps - If selected, Maemo - Mapper will delete maps from your file system, for the area you - specify. - - - By Area - If selected, Maemo Mapper - will download or delete maps for a particular rectangular area of - the world, based on the latitude and longitude of an upper-left - and lower-right corner. See the Area - tab to specify the coordinates. - - - Along Route - If selected, Maemo - Mapper will download or delete maps along your current route. - This is useful if, for example, you are about to embark on a trip - and want to make sure that you have maps for all points along the - route. - - - Radius (tiles) - If - Along Route is selected, then you can - specify the radius around your route for which maps will be - downloaded or deleted. For example, if you specify 4 (the - default), then Maemo Mapper will download all tiles that are - within 4 tiles of your route. - - - Zoom - - The Zoom tab controls which zoom levels - at which maps are downloaded or deleted. The current zoom level is - selected by default, but you can enable or disable any zoom levels - that you like. - - Area - - The Area tab, available if the - By Area option is selected in the - Setup tab, defines the rectangular area - of the world for which maps will be downloaded or deleted. If - applicable, the fields are pre-filled with your current and previous - view center coordinates. This allows you to graphically choose your - rectangle by first centering on one corner of the rectangle, then - centering on the opposite corner, by tapping the screen or by using - the Lat/Lon menu item of the - Go to menu. - - - - POI Categories - - - POI Categories are a means by which you can organize your POIs for - selective display. The POI Categories - dialog is accessed from the View menu - and allows you to enable/disable, add, edit, or delete categories. - - - Each row in the table represents a category. There are three - columns displayed for each category: - - - - Enabled - Controls whether or not - POIs in this category are drawn on the map. - - - Label - A short label to describe the - category. This is the name that will be visible when viewing a - POI. - - - Description - A longer description of - the category. This description is not visible anywhere except in - this dialog; it is only used to get an idea of how the category is - meant to be used. - - - - Selecting a row in the table and pressing the - Edit button will allow you to edit the - above three attributes of a category, and to delete a category. You - can also add a new category by using the - Add button. - - - A POI may only be associated with a single category at a time. - - - - Settings - - - The Settings dialog (accessible from - the main menu) provides access to a plethora of configurable options - that control how Maemo Mapper appears and runs. In addition to the - tabs, which are described below, there are also two buttons at the - bottom of the diagram labeled Hardware - Keys... and Colors.... - - - The Hardware Keys... button brings up - another dialog box, which allows you to customize the actions that - each hardware key causes. For example, you can map the - button to cycle through map - repositories, giving you quick access to switching among them. - - - The Colors... button allows you to - customize the colors that are used for drawing on-map objects. - - GPS - - The GPS tab tells Maemo Mapper which - bluetooth device from which to retrieve GPS data. It is only - applicable if you have a bluetooth GPS receiver with which to use - Maemo Mapper. - - - Enter the MAC address in the field provided. If you don't know the - MAC address, turn on your receiver and press the - Scan... button to select it from a - list of nearby bluetooth devices. - - - Alternatively, if you are using rfcomm or any other - file-system-based NMEA input source, you can provide a pathname - (beginning with a leading slash) such as "/dev/rfcomm1". In this - case, Maemo Mapper will read NMEA sentences from the file system - instead of via bluetooth. - - Auto-Center - - The Auto-Center tab allows you to - configure how Maemo Mapper automatically re-centers the display when - either Lat/Lon or - Lead is enabled from the - Auto-Center menu. The Auto-Center - feature is most useful in conjunction with a GPS receiver. - - - - Sensitivity - Controls how often - Maemo Mapper re-centers the display, based on how close your - position (or the position of your lead) gets to the edge of - the screen. When set to a low value, Maemo Mapper will only - re-center the screen when you are near the edge of the screen. - When set to the maximum, Maemo Mapper will keep your position as - close to the center as possible. - - - Lead Amount - When Auto-Center is set - to Lead, then Maemo Mapper will keep - the center of the screen focused on an area in front of you. When - driving, this allows you to view more of the road ahead of you. - The distance in front of you on which the screen is centered is - based on two variables: your current speed and the value of the - Lead Amount option. - - - Announce - - The Announce tab controls how and when - Maemo Mapper displays or speaks waypoint information. When you - approach a waypoint in your route (defined by the presence of a - description in the GPX file), Maemo Mapper will pop up a text box - with the contents of that description. When downloading routes from - within Maemo Mapper, the text describes your next action, e.g. "Turn - left at Main Street. Go 2.4 miles." - - - As you approach a waypoint, Maemo Mapper will continue to display - the description of that waypoint, so long as you are within the - range defined by the Advance Notice - option, or until you pass the waypoint. Because the amount of - notice is dependent on your speed, it is possible to see the text, - then slow down to a point where the notice disappears. This is - possible, for example, if you are stopped at a red light. The text - will reappear when you have picked up enough speed to again break - the Advance Notice range. - - - If you have installed flite, which is available in the same - repository from which you downloaded Maemo Mapper, then Maemo Mapper - can optionally also speak the same directions that appear on screen. - Maemo Mapper will only speak the directions once, at the exact - moment you first reach the distance from the waypoint defined by the - Advance Notice option. The same - directions are on-screen if you need to reference them. - - - - Advance Notice - Controls how much in - advance Maemo Mapper begins to provide the waypoint description. - The exact distance at which Maemo Mapper begins to announce a - waypoint also depends on your speed, so the value of this option - can be thought of more accurately in units of time. At the - minimum value, Maemo Mapper gives you almost no notice. At the - maximum value, Maemo Mapper gives you about two minutes of notice. - Experiment to find your happy medium. - - - Enable Voice Synthesis - If you have - installed flite, this option will cause Maemo Mapper to - speak the description of the next waypoint when you enter the - range defined by the Advance Notice - option. - - - Misc. - - The Misc. and Misc. - 2 tabs contain miscellaneous options. - - - - Line Width - Controls the thickness - of all lines drawn on top of the map images. This includes your - mark, all tracks and routes, and the default POI image. - - - Keep Display On Only in Fullscreen - Mode - Controls whether or not Maemo Mapper - should limit its "Keep the display on" behavior to full screen - mode only. If disabled, then Maemo Mapper will always keep the - screen on, as long as you are moving. If enabled, Maemo Mapper - will only keep the screen on in full screen mode. - - - Information Font Size - Controls the - font size for all information that is popped up to the user in the - upper-right corner, including waypoint descriptions. - - - Units - Controls the units in which - distances and speeds are displayed in the user interface. - - - Degrees Format - Controls how - latitude and longitudes are displayed in the user interface. - - - Speed Limit - Enables notification - when you have exceeded the given speed limit (specified in the - units defined via the Units option. - - - Location - Controls the location on - the screen of the speed warning. - - - POI - - The POI tab allows you to define your - POI database and how POIs are drawn on the screen. - - - - POI database - The location on the - file system where the POI database is located. The database must - be in sqlite3 format. A default (empty) POI database is - automatically created for you when you first run Maemo Mapper. - - - Show POI below zoom - Defines the - maximum zoom (furthest away from the Earth) at which POIs will be - drawn. When zoomed out beyond this level, no POIs will be drawn. - - - - - About Maemo Mapper - - - Current Version: 1.4.4 - - - Maemo Mapper was created and developed by John Costigan (aka - gnuite). - - - Copyright © 2006-2007 John Costigan. - - - POI and GPS-Info code originally written by Cezary Jackiewicz. - - - Default map data provided by http://www.openstreetmap.org/ - other - map repositories are subject to their own licenses and may or may not - be suitable for use with Maemo Mapper. It may be illegal to use a - certain repository with Maemo Mapper or under certain conditions. This - includes the repositories downloadable directly in Maemo Mapper. If - you are not sure if you are legally allowed to use a particular - repository, you should delete it from your list of repositories. The - authors of Maemo Mapper cannot be held responsible for your use of a - particular repository. - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - - - diff --git a/intltool-update b/intltool-update deleted file mode 100755 index afe00cf..0000000 --- a/intltool-update +++ /dev/null @@ -1,1063 +0,0 @@ -#!/scratchbox/tools/bin/perl -w -# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- - -# -# The Intltool Message Updater -# -# Copyright (C) 2000-2003 Free Software Foundation. -# -# Intltool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# version 2 published by the Free Software Foundation. -# -# Intltool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -# -# Authors: Kenneth Christiansen -# Maciej Stachowiak -# Darin Adler - -## Release information -my $PROGRAM = "intltool-update"; -my $VERSION = "0.33"; -my $PACKAGE = "intltool"; - -## Loaded modules -use strict; -use Getopt::Long; -use Cwd; -use File::Copy; -use File::Find; - -## Scalars used by the option stuff -my $HELP_ARG = 0; -my $VERSION_ARG = 0; -my $DIST_ARG = 0; -my $POT_ARG = 0; -my $HEADERS_ARG = 0; -my $MAINTAIN_ARG = 0; -my $REPORT_ARG = 0; -my $VERBOSE = 0; -my $GETTEXT_PACKAGE = ""; -my $OUTPUT_FILE = ""; - -my @languages; -my %varhash = (); -my %po_files_by_lang = (); - -# Regular expressions to categorize file types. -# FIXME: Please check if the following is correct - -my $xml_support = -"xml(?:\\.in)*|". # http://www.w3.org/XML/ (Note: .in is not required) -"ui|". # Bonobo specific - User Interface desc. files -"lang|". # ? -"glade2?(?:\\.in)*|". # Glade specific - User Interface desc. files (Note: .in is not required) -"scm(?:\\.in)*|". # ? (Note: .in is not required) -"oaf(?:\\.in)+|". # DEPRECATED: Replaces by Bonobo .server files -"etspec|". # ? -"server(?:\\.in)+|". # Bonobo specific -"sheet(?:\\.in)+|". # ? -"schemas(?:\\.in)+|". # GConf specific -"pong(?:\\.in)+|". # DEPRECATED: PONG is not used [by GNOME] any longer. -"kbd(?:\\.in)+"; # GOK specific. - -my $ini_support = -"icon(?:\\.in)+|". # http://www.freedesktop.org/Standards/icon-theme-spec -"desktop(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec -"caves(?:\\.in)+|". # GNOME Games specific -"directory(?:\\.in)+|". # http://www.freedesktop.org/Standards/menu-spec -"soundlist(?:\\.in)+|". # GNOME specific -"keys(?:\\.in)+|". # GNOME Mime database specific -"theme(?:\\.in)+"; # http://www.freedesktop.org/Standards/icon-theme-spec - -my $buildin_gettext_support = -"c|y|cs|cc|cpp|c\\+\\+|h|hh|gob|py"; - -## Always flush buffer when printing -$| = 1; - -## Sometimes the source tree will be rooted somewhere else. -my $SRCDIR = "."; -my $POTFILES_in; - -$SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"}; -$POTFILES_in = "<$SRCDIR/POTFILES.in"; - -## Handle options -GetOptions -( - "help" => \$HELP_ARG, - "version" => \$VERSION_ARG, - "dist|d" => \$DIST_ARG, - "pot|p" => \$POT_ARG, - "headers|s" => \$HEADERS_ARG, - "maintain|m" => \$MAINTAIN_ARG, - "report|r" => \$REPORT_ARG, - "verbose|x" => \$VERBOSE, - "gettext-package|g=s" => \$GETTEXT_PACKAGE, - "output-file|o=s" => \$OUTPUT_FILE, - ) or &Console_WriteError_InvalidOption; - -&Console_Write_IntltoolHelp if $HELP_ARG; -&Console_Write_IntltoolVersion if $VERSION_ARG; - -my $arg_count = ($DIST_ARG > 0) - + ($POT_ARG > 0) - + ($HEADERS_ARG > 0) - + ($MAINTAIN_ARG > 0) - + ($REPORT_ARG > 0); - -&Console_Write_IntltoolHelp if $arg_count > 1; - -# --version and --help don't require a module name -my $MODULE = $GETTEXT_PACKAGE || &FindPackageName; - -if ($POT_ARG) -{ - &GenerateHeaders; - &GeneratePOTemplate; -} -elsif ($HEADERS_ARG) -{ - &GenerateHeaders; -} -elsif ($MAINTAIN_ARG) -{ - &FindLeftoutFiles; -} -elsif ($REPORT_ARG) -{ - &GenerateHeaders; - &GeneratePOTemplate; - &Console_Write_CoverageReport; -} -elsif ((defined $ARGV[0]) && $ARGV[0] =~ /^[a-z]/) -{ - my $lang = $ARGV[0]; - - ## Report error if the language file supplied - ## to the command line is non-existent - &Console_WriteError_NotExisting("$SRCDIR/$lang.po") - if ! -s "$SRCDIR/$lang.po"; - - if (!$DIST_ARG) - { - print "Working, please wait..." if $VERBOSE; - &GenerateHeaders; - &GeneratePOTemplate; - } - &POFile_Update ($lang, $OUTPUT_FILE); - &Console_Write_TranslationStatus ($lang, $OUTPUT_FILE); -} -else -{ - &Console_Write_IntltoolHelp; -} - -exit; - -######### - -sub Console_Write_IntltoolVersion -{ - print <<_EOF_; -${PROGRAM} (${PACKAGE}) $VERSION -Written by Kenneth Christiansen, Maciej Stachowiak, and Darin Adler. - -Copyright (C) 2000-2003 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -_EOF_ - exit; -} - -sub Console_Write_IntltoolHelp -{ - print <<_EOF_; -Usage: ${PROGRAM} [OPTION]... LANGCODE -Updates PO template files and merge them with the translations. - -Mode of operation (only one is allowed): - -p, --pot generate the PO template only - -s, --headers generate the header files in POTFILES.in - -m, --maintain search for left out files from POTFILES.in - -r, --report display a status report for the module - -d, --dist merge LANGCODE.po with existing PO template - -Extra options: - -g, --gettext-package=NAME override PO template name, useful with --pot - -o, --output-file=FILE write merged translation to FILE - -x, --verbose display lots of feedback - --help display this help and exit - --version output version information and exit - -Examples of use: -${PROGRAM} --pot just create a new PO template -${PROGRAM} xy create new PO template and merge xy.po with it - -Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE") -or send email to . -_EOF_ - exit; -} - -sub echo_n -{ - my $str = shift; - my $ret = `echo "$str"`; - - $ret =~ s/\n$//; # do we need the "s" flag? - - return $ret; -} - -sub POFile_DetermineType ($) -{ - my $type = $_; - my $gettext_type; - - my $xml_regex = "(?:" . $xml_support . ")"; - my $ini_regex = "(?:" . $ini_support . ")"; - my $buildin_regex = "(?:" . $buildin_gettext_support . ")"; - - if ($type =~ /\[type: gettext\/([^\]].*)]/) - { - $gettext_type=$1; - } - elsif ($type =~ /schemas(\.in)+$/) - { - $gettext_type="schemas"; - } - elsif ($type =~ /glade2?(\.in)*$/) - { - $gettext_type="glade"; - } - elsif ($type =~ /scm(\.in)*$/) - { - $gettext_type="scheme"; - } - elsif ($type =~ /keys(\.in)+$/) - { - $gettext_type="keys"; - } - - # bucket types - - elsif ($type =~ /$xml_regex$/) - { - $gettext_type="xml"; - } - elsif ($type =~ /$ini_regex$/) - { - $gettext_type="ini"; - } - elsif ($type =~ /$buildin_regex$/) - { - $gettext_type="buildin"; - } - else - { - $gettext_type="unknown"; - } - - return "gettext\/$gettext_type"; -} - -sub TextFile_DetermineEncoding ($) -{ - my $gettext_code="ASCII"; # All files are ASCII by default - my $filetype=`file $_ | cut -d ' ' -f 2`; - - if ($? eq "0") - { - if ($filetype =~ /^(ISO|UTF)/) - { - chomp ($gettext_code = $filetype); - } - elsif ($filetype =~ /^XML/) - { - $gettext_code="UTF-8"; # We asume that .glade and other .xml files are UTF-8 - } - } - - return $gettext_code; -} - -sub isNotValidMissing -{ - my ($file) = @_; - - return if $file =~ /^\{arch\}\/.*$/; - return if $file =~ /^$varhash{"PACKAGE"}-$varhash{"VERSION"}\/.*$/; -} - -sub FindLeftoutFiles -{ - my (@buf_i18n_plain, - @buf_i18n_xml, - @buf_i18n_xml_unmarked, - @buf_i18n_ini, - @buf_potfiles, - @buf_potfiles_ignore, - @buf_allfiles, - @buf_allfiles_sorted, - @buf_potfiles_sorted - ); - - ## Search and find all translatable files - find sub { - push @buf_i18n_plain, "$File::Find::name" if /\.($buildin_gettext_support)$/; - push @buf_i18n_xml, "$File::Find::name" if /\.($xml_support)$/; - push @buf_i18n_ini, "$File::Find::name" if /\.($ini_support)$/; - push @buf_i18n_xml_unmarked, "$File::Find::name" if /\.(schemas(\.in)+)$/; - }, ".."; - - - open POTFILES, $POTFILES_in or die "$PROGRAM: there's no POTFILES.in!\n"; - @buf_potfiles = grep !/^(#|\s*$)/, ; - close POTFILES; - - foreach (@buf_potfiles) { - s/^\[.*]\s*//; - } - - print "Searching for missing translatable files...\n" if $VERBOSE; - - ## Check if we should ignore some found files, when - ## comparing with POTFILES.in - foreach my $ignore ("POTFILES.skip", "POTFILES.ignore") - { - (-s $ignore) or next; - - if ("$ignore" eq "POTFILES.ignore") - { - print "The usage of POTFILES.ignore is deprecated. Please consider moving the\n". - "content of this file to POTFILES.skip.\n"; - } - - print "Found $ignore: Ignoring files...\n" if $VERBOSE; - open FILE, "<$ignore" or die "ERROR: Failed to open $ignore!\n"; - - while () - { - push @buf_potfiles_ignore, $_ unless /^(#|\s*$)/; - } - close FILE; - - @buf_potfiles = (@buf_potfiles_ignore, @buf_potfiles); - } - - foreach my $file (@buf_i18n_plain) - { - my $in_comment = 0; - my $in_macro = 0; - - open FILE, "<$file"; - while () - { - # Handle continued multi-line comment. - if ($in_comment) - { - next unless s-.*\*/--; - $in_comment = 0; - } - - # Handle continued macro. - if ($in_macro) - { - $in_macro = 0 unless /\\$/; - next; - } - - # Handle start of macro (or any preprocessor directive). - if (/^\s*\#/) - { - $in_macro = 1 if /^([^\\]|\\.)*\\$/; - next; - } - - # Handle comments and quoted text. - while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy - { - my $match = $1; - if ($match eq "/*") - { - if (!s-/\*.*?\*/--) - { - s-/\*.*--; - $in_comment = 1; - } - } - elsif ($match eq "//") - { - s-//.*--; - } - else # ' or " - { - if (!s-$match([^\\]|\\.)*?$match-QUOTEDTEXT-) - { - warn "mismatched quotes at line $. in $file\n"; - s-$match.*--; - } - } - } - - if (/\.GetString ?\(QUOTEDTEXT/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - - if (/_\(QUOTEDTEXT/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_xml) - { - open FILE, "<$file"; - - while () - { - # FIXME: share the pattern matching code with intltool-extract - if (/\s_(.*)=\"/ || /<_[^>]+>/ || /translatable=\"yes\"/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_ini) - { - open FILE, "<$file"; - while () - { - if (/_(.*)=/) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - last; - } - } - close FILE; - } - - foreach my $file (@buf_i18n_xml_unmarked) - { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } - } - - - @buf_allfiles_sorted = sort (@buf_allfiles); - @buf_potfiles_sorted = sort (@buf_potfiles); - - my %in2; - foreach (@buf_potfiles_sorted) - { - $in2{$_} = 1; - } - - my @result; - - foreach (@buf_allfiles_sorted) - { - if (!exists($in2{$_})) - { - push @result, $_ - } - } - - my @buf_potfiles_notexist; - - foreach (@buf_potfiles_sorted) - { - chomp (my $dummy = $_); - if ("$dummy" ne "" and ! -f "../$dummy") - { - push @buf_potfiles_notexist, $_; - } - } - - ## Save file with information about the files missing - ## if any, and give information about this procedure. - if (@result + @buf_potfiles_notexist > 0) - { - if (@result) - { - print "\n" if $VERBOSE; - unlink "missing"; - open OUT, ">missing"; - print OUT @result; - close OUT; - warn "\e[1mThe following files contain translations and are currently not in use. Please\e[0m\n". - "\e[1mconsider adding these to the POTFILES.in file, located in the po/ directory.\e[0m\n\n"; - print STDERR @result, "\n"; - warn "If some of these files are left out on purpose then please add them to\n". - "POTFILES.skip instead of POTFILES.in. A file \e[1m'missing'\e[0m containing this list\n". - "of left out files has been written in the current directory.\n"; - } - if (@buf_potfiles_notexist) - { - unlink "notexist"; - open OUT, ">notexist"; - print OUT @buf_potfiles_notexist; - close OUT; - warn "\n" if ($VERBOSE or @result); - warn "\e[1mThe following files do not exist anymore:\e[0m\n\n"; - warn @buf_potfiles_notexist, "\n"; - warn "Please remove them from POTFILES.in or POTFILES.skip. A file \e[1m'notexist'\e[0m\n". - "containing this list of absent files has been written in the current directory.\n"; - } - } - - ## If there is nothing to complain about, notify the user - else { - print "\nAll files containing translations are present in POTFILES.in.\n" if $VERBOSE; - } -} - -sub Console_WriteError_InvalidOption -{ - ## Handle invalid arguments - print STDERR "Try `${PROGRAM} --help' for more information.\n"; - exit 1; -} - -sub GenerateHeaders -{ - my $EXTRACT = "/home/milang/src/mapper/intltool-extract"; - chomp $EXTRACT; - - $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"}; - - ## Generate the .h header files, so we can allow glade and - ## xml translation support - if (! -x "$EXTRACT") - { - print STDERR "\n *** The intltool-extract script wasn't found!" - ."\n *** Without it, intltool-update can not generate files.\n"; - exit; - } - else - { - open (FILE, $POTFILES_in) or die "$PROGRAM: POTFILES.in not found.\n"; - - while () - { - chomp; - next if /^\[\s*encoding/; - - ## Find xml files in POTFILES.in and generate the - ## files with help from the extract script - - my $gettext_type= &POFile_DetermineType ($1); - - if (/\.($xml_support|$ini_support)$/ || /^\[/) - { - s/^\[[^\[].*]\s*//; - - my $filename = "../$_"; - - if ($VERBOSE) - { - system ($EXTRACT, "--update", "--srcdir=$SRCDIR", - "--type=$gettext_type", $filename); - } - else - { - system ($EXTRACT, "--update", "--type=$gettext_type", - "--srcdir=$SRCDIR", "--quiet", $filename); - } - } - } - close FILE; - } -} - -# -# Generate .pot file from POTFILES.in -# -sub GeneratePOTemplate -{ - my $XGETTEXT = $ENV{"XGETTEXT"} || "/scratchbox/tools/bin/xgettext"; - my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || ''; - chomp $XGETTEXT; - - if (! -x $XGETTEXT) - { - print STDERR " *** xgettext is not found on this system!\n". - " *** Without it, intltool-update can not extract strings.\n"; - exit; - } - - print "Building $MODULE.pot...\n" if $VERBOSE; - - open INFILE, $POTFILES_in; - unlink "POTFILES.in.temp"; - open OUTFILE, ">POTFILES.in.temp" or die("Cannot open POTFILES.in.temp for writing"); - - my $gettext_support_nonascii = 0; - - # checks for GNU gettext >= 0.12 - my $dummy = `$XGETTEXT --version --from-code=UTF-8 >/dev/null 2>/dev/null`; - if ($? == 0) - { - $gettext_support_nonascii = 1; - } - else - { - # urge everybody to upgrade gettext - print STDERR "WARNING: This version of gettext does not support extracting non-ASCII\n". - " strings. That means you should install a version of gettext\n". - " that supports non-ASCII strings (such as GNU gettext >= 0.12),\n". - " or have to let non-ASCII strings untranslated. (If there is any)\n"; - } - - my $encoding = "ASCII"; - my $forced_gettext_code; - my @temp_headers; - my $encoding_problem_is_reported = 0; - - while () - { - next if (/^#/ or /^\s*$/); - - chomp; - - my $gettext_code; - - if (/^\[\s*encoding:\s*(.*)\s*\]/) - { - $forced_gettext_code=$1; - } - elsif (/\.($xml_support|$ini_support)$/ || /^\[/) - { - s/^\[.*]\s*//; - print OUTFILE "../$_.h\n"; - push @temp_headers, "../$_.h"; - $gettext_code = &TextFile_DetermineEncoding ("../$_.h") if ($gettext_support_nonascii and not defined $forced_gettext_code); - } - else - { - if ($SRCDIR eq ".") { - print OUTFILE "../$_\n"; - } else { - print OUTFILE "$SRCDIR/../$_\n"; - } - $gettext_code = &TextFile_DetermineEncoding ("../$_") if ($gettext_support_nonascii and not defined $forced_gettext_code); - } - - next if (! $gettext_support_nonascii); - - if (defined $forced_gettext_code) - { - $encoding=$forced_gettext_code; - } - elsif (defined $gettext_code and "$encoding" ne "$gettext_code") - { - if ($encoding eq "ASCII") - { - $encoding=$gettext_code; - } - elsif ($gettext_code ne "ASCII") - { - # Only report once because the message is quite long - if (! $encoding_problem_is_reported) - { - print STDERR "WARNING: You should use the same file encoding for all your project files,\n". - " but $PROGRAM thinks that most of the source files are in\n". - " $encoding encoding, while \"$_\" is (likely) in\n". - " $gettext_code encoding. If you are sure that all translatable strings\n". - " are in same encoding (say UTF-8), please \e[1m*prepend*\e[0m the following\n". - " line to POTFILES.in:\n\n". - " [encoding: UTF-8]\n\n". - " and make sure that configure.in/ac checks for $PACKAGE >= 0.27 .\n". - "(such warning message will only be reported once.)\n"; - $encoding_problem_is_reported = 1; - } - } - } - } - - close OUTFILE; - close INFILE; - - unlink "$MODULE.pot"; - my @xgettext_argument=("$XGETTEXT", - "--add-comments", - "--directory\=\.", - "--output\=$MODULE\.pot", - "--files-from\=\.\/POTFILES\.in\.temp"); - my $XGETTEXT_KEYWORDS = &FindPOTKeywords; - push @xgettext_argument, $XGETTEXT_KEYWORDS; - push @xgettext_argument, "--from-code\=$encoding" if ($gettext_support_nonascii); - push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS; - my $xgettext_command = join ' ', @xgettext_argument; - - # intercept xgettext error message - print "Running $xgettext_command\n" if $VERBOSE; - my $xgettext_error_msg = `$xgettext_command 2>\&1`; - my $command_failed = $?; - - unlink "POTFILES.in.temp"; - - print "Removing generated header (.h) files..." if $VERBOSE; - unlink foreach (@temp_headers); - print "done.\n" if $VERBOSE; - - if (! $command_failed) - { - if (! -e "$MODULE.pot") - { - print "None of the files in POTFILES.in contain strings marked for translation.\n" if $VERBOSE; - } - else - { - print "Wrote $MODULE.pot\n" if $VERBOSE; - } - } - else - { - if ($xgettext_error_msg =~ /--from-code/) - { - # replace non-ASCII error message with a more useful one. - print STDERR "ERROR: xgettext failed to generate PO template file because there is non-ASCII\n". - " string marked for translation. Please make sure that all strings marked\n". - " for translation are in uniform encoding (say UTF-8), then \e[1m*prepend*\e[0m the\n". - " following line to POTFILES.in and rerun $PROGRAM:\n\n". - " [encoding: UTF-8]\n\n"; - } - else - { - print STDERR "$xgettext_error_msg"; - if (-e "$MODULE.pot") - { - # is this possible? - print STDERR "ERROR: xgettext failed but still managed to generate PO template file.\n". - " Please consult error message above if there is any.\n"; - } - else - { - print STDERR "ERROR: xgettext failed to generate PO template file. Please consult\n". - " error message above if there is any.\n"; - } - } - exit (1); - } -} - -sub POFile_Update -{ - -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n"; - - my $MSGMERGE = $ENV{"MSGMERGE"} || "/scratchbox/tools/bin/msgmerge"; - my ($lang, $outfile) = @_; - - print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE; - - my $infile = "$SRCDIR/$lang.po"; - $outfile = "$SRCDIR/$lang.po" if ($outfile eq ""); - - # I think msgmerge won't overwrite old file if merge is not successful - system ("$MSGMERGE", "-o", $outfile, $infile, "$MODULE.pot"); -} - -sub Console_WriteError_NotExisting -{ - my ($file) = @_; - - ## Report error if supplied language file is non-existing - print STDERR "$PROGRAM: $file does not exist!\n"; - print STDERR "Try '$PROGRAM --help' for more information.\n"; - exit; -} - -sub GatherPOFiles -{ - my @po_files = glob ("./*.po"); - - @languages = map (&POFile_GetLanguage, @po_files); - - foreach my $lang (@languages) - { - $po_files_by_lang{$lang} = shift (@po_files); - } -} - -sub POFile_GetLanguage ($) -{ - s/^(.*\/)?(.+)\.po$/$2/; - return $_; -} - -sub Console_Write_TranslationStatus -{ - my ($lang, $output_file) = @_; - my $MSGFMT = $ENV{"MSGFMT"} || "/scratchbox/tools/bin/msgfmt"; - - $output_file = "$SRCDIR/$lang.po" if ($output_file eq ""); - - system ("$MSGFMT", "-o", "/dev/null", "--statistics", $output_file); -} - -sub Console_Write_CoverageReport -{ - my $MSGFMT = $ENV{"MSGFMT"} || "/scratchbox/tools/bin/msgfmt"; - - &GatherPOFiles; - - foreach my $lang (@languages) - { - print "$lang: "; - &POFile_Update ($lang, ""); - } - - print "\n\n * Current translation support in $MODULE \n\n"; - - foreach my $lang (@languages) - { - print "$lang: "; - system ("$MSGFMT", "-o", "/dev/null", "--statistics", "$SRCDIR/$lang.po"); - } -} - -sub SubstituteVariable -{ - my ($str) = @_; - - # always need to rewind file whenever it has been accessed - seek (CONF, 0, 0); - - # cache each variable. varhash is global to we can add - # variables elsewhere. - while () - { - if (/^(\w+)=(.*)$/) - { - ($varhash{$1} = $2) =~ s/^["'](.*)["']$/$1/; - } - } - - if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/) - { - my $rest = $3; - my $untouched = $1; - my $sub = $varhash{$2}; - - return SubstituteVariable ("$untouched$sub$rest"); - } - - # We're using Perl backticks ` and "echo -n" here in order to - # expand any shell escapes (such as backticks themselves) in every variable - return echo_n ($str); -} - -sub CONF_Handle_Open -{ - my $base_dirname = getcwd(); - $base_dirname =~ s@.*/@@; - - my ($conf_in, $src_dir); - - if ($base_dirname =~ /^po(-.+)?$/) - { - if (-f "Makevars") - { - my $makefile_source; - - local (*IN); - open (IN, ") - { - if (/^top_builddir[ \t]*=/) - { - $src_dir = $_; - $src_dir =~ s/^top_builddir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; - - chomp $src_dir; - if (-f "$src_dir" . "/configure.ac") { - $conf_in = "$src_dir" . "/configure.ac" . "\n"; - } else { - $conf_in = "$src_dir" . "/configure.in" . "\n"; - } - last; - } - } - close IN; - - $conf_in || die "Cannot find top_builddir in Makevars."; - } - elsif (-f "../configure.ac") - { - $conf_in = "../configure.ac"; - } - elsif (-f "../configure.in") - { - $conf_in = "../configure.in"; - } - else - { - my $makefile_source; - - local (*IN); - open (IN, ") - { - if (/^top_srcdir[ \t]*=/) - { - $src_dir = $_; - $src_dir =~ s/^top_srcdir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/; - - chomp $src_dir; - $conf_in = "$src_dir" . "/configure.in" . "\n"; - - last; - } - } - close IN; - - $conf_in || die "Cannot find top_srcdir in Makefile."; - } - - open (CONF, "<$conf_in"); - } - else - { - print STDERR "$PROGRAM: Unable to proceed.\n" . - "Make sure to run this script inside the po directory.\n"; - exit; - } -} - -sub FindPackageName -{ - my $version; - my $domain = &FindMakevarsDomain; - my $name = $domain || "untitled"; - - &CONF_Handle_Open; - - my $conf_source; { - local (*IN); - open (IN, "<&CONF") || return $name; - seek (IN, 0, 0); - local $/; # slurp mode - $conf_source = ; - close IN; - } - - # priority for getting package name: - # 1. GETTEXT_PACKAGE - # 2. first argument of AC_INIT (with >= 2 arguments) - # 3. first argument of AM_INIT_AUTOMAKE (with >= 2 argument) - - # /^AM_INIT_AUTOMAKE\([\s\[]*([^,\)\s\]]+)/m - # the \s makes this not work, why? - if ($conf_source =~ /^AM_INIT_AUTOMAKE\(([^,\)]+),([^,\)]+)/m) - { - ($name, $version) = ($1, $2); - $name =~ s/[\[\]\s]//g; - $version =~ s/[\[\]\s]//g; - $varhash{"AC_PACKAGE_NAME"} = $name; - $varhash{"PACKAGE"} = $name; - $varhash{"AC_PACKAGE_VERSION"} = $version; - $varhash{"VERSION"} = $version; - } - - if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)/m) - { - ($name, $version) = ($1, $2); - $name =~ s/[\[\]\s]//g; - $version =~ s/[\[\]\s]//g; - $varhash{"AC_PACKAGE_NAME"} = $name; - $varhash{"PACKAGE"} = $name; - $varhash{"AC_PACKAGE_VERSION"} = $version; - $varhash{"VERSION"} = $version; - } - - # \s makes this not work, why? - $name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m; - - # prepend '$' to auto* internal variables, usually they are - # used in configure.in/ac without the '$' - $name =~ s/AC_/\$AC_/g; - $name =~ s/\$\$/\$/g; - - $name = $domain if $domain; - - $name = SubstituteVariable ($name); - $name =~ s/^["'](.*)["']$/$1/; - - return $name if $name; -} - - -sub FindPOTKeywords -{ - - my $keywords = "--keyword\=\_ --keyword\=N\_ --keyword\=U\_ --keyword\=Q\_"; - my $varname = "XGETTEXT_OPTIONS"; - my $make_source; { - local (*IN); - open (IN, "; - close IN; - } - - $keywords = $1 if $make_source =~ /^$varname[ ]*=\[?([^\n\]]+)/m; - - return $keywords; -} - -sub FindMakevarsDomain -{ - - my $domain = ""; - my $makevars_source; { - local (*IN); - open (IN, "; - close IN; - } - - $domain = $1 if $makevars_source =~ /^DOMAIN[ ]*=\[?([^\n\]\$]+)/m; - $domain =~ s/^\s+//; - $domain =~ s/\s+$//; - - return $domain; -}