Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
QGIS By Example

You're reading from   QGIS By Example Leverage the power of QGIS in real-world applications to become a powerful user in cartography and GIS analysis

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781782174677
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Handling Your Data FREE CHAPTER 2. Visualizing and Styling the Data 3. Presenting Data on a Print Map 4. Publishing the Map Online 5. Answering Questions with Density Analysis 6. Answering Questions with Visibility Analysis 7. Answering Questions with Suitability Analysis 8. Automating Analysis with Processing Models 9. Automating Analysis with Processing Scripts 10. Developing a Python Plugin – Select by Radius Index

Adding translations

If you followed our recommendations and used the English language for all captions in the plugin GUI, and in all strings in the code, almost all users will be able to use your plugin. Moreover, as we have made all strings translatable by enclosing them in self.tr() calls, it is very easy to translate our plugin into another language.

To do this, we need to prepare a so-called project file. This is a plain text file with a very simple structure. Create a new file and save it as selectradius.pro in the plugin root directory. Then, add the following content to it:

( 1) SOURCES = __init__.py \
( 2)          selectradius_plugin.py \
( 3)          gui/selectradiusdialog.py \
( 4)          gui/aboutdialog.py \
( 5)
( 6) FORMS = ui/selectradiusdialogbase.ui \
( 7)        ui/aboutdialogbase.ui
( 8)
( 9) TRANSLATIONS = i18n/selectradius_uk.ts \
(10)              i18n/selectradius_de.ts

As you can see, there is a list of all plugin source files from all subdirectories (lines 1 to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image