FreeCAD

Форк
0
/
TranslationTexts.py 
163 строки · 9.4 Кб
1
# ***************************************************************************
2
# *   Copyright (c) 2012 Yorik van Havre <yorik@uncreated.net>              *
3
# *                                                                         *
4
# *   This program is free software; you can redistribute it and/or modify  *
5
# *   it under the terms of the GNU Lesser General Public License (LGPL)    *
6
# *   as published by the Free Software Foundation; either version 2 of     *
7
# *   the License, or (at your option) any later version.                   *
8
# *   for detail see the LICENCE text file.                                 *
9
# *                                                                         *
10
# *   This program is distributed in the hope that it will be useful,       *
11
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
# *   GNU Library General Public License for more details.                  *
14
# *                                                                         *
15
# *   You should have received a copy of the GNU Library General Public     *
16
# *   License along with this program; if not, write to the Free Software   *
17
# *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
18
# *   USA                                                                   *
19
# *                                                                         *
20
# ***************************************************************************
21

22
from PySide import QtGui
23

24

25
def translate(context, text):
26

27
    "convenience function for the Qt translator"
28

29
    try:
30
        _encoding = QtGui.QApplication.UnicodeUTF8
31
        u = QtGui.QApplication.translate(context, text, None, _encoding)
32
    except AttributeError:
33
        u = QtGui.QApplication.translate(context, text, None)
34

35
    return u.replace(chr(39), "&rsquo;")
36

37

38
def get(handle):
39

40
    "returns the translated text of the given handle"
41

42
    T_TITLE = translate("StartPage", "Start")
43
    T_WELCOME = translate("StartPage", "Welcome to FreeCAD")
44
    T_DOCUMENTS = translate("StartPage", "Documents")
45
    T_HELP = translate("StartPage", "Help")
46
    T_ACTIVITY = translate("StartPage", "Activity")
47
    T_BLOG = translate("StartPage", "Blog")
48
    T_TOOLTIP_BLOG = translate("StartPage", "Link to the FreeCAD blog")
49
    T_NEWFILE = translate("StartPage", "New file")
50
    T_TEMPLATE_EMPTYFILE_NAME = translate("StartPage", "Empty File")
51
    T_TEMPLATE_EMPTYFILE_DESC = translate("StartPage", "Create an empty FreeCAD file")
52
    T_TEMPLATE_OPENFILE_NAME = translate("StartPage", "Open File")
53
    T_TEMPLATE_OPENFILE_DESC = translate("StartPage", "Open an existing CAD file or 3D model")
54
    T_TEMPLATE_PARAMETRICPART_NAME = translate("StartPage", "Parametric Part")
55
    T_TEMPLATE_PARAMETRICPART_DESC = translate(
56
        "StartPage", "Create a part with the Part Design workbench"
57
    )
58
    T_TEMPLATE_ASSEMBLY_NAME = translate("StartPage", "Assembly")
59
    T_TEMPLATE_ASSEMBLY_DESC = translate(
60
        "StartPage", "Create an assembly with the Assembly workbench"
61
    )
62
    # T_TEMPLATE_CSGPART_NAME = translate("StartPage", "CSG Part")
63
    # T_TEMPLATE_CSGPART_DESC = translate("StartPage", "Create a part with the Part workbench")
64
    T_TEMPLATE_2DDRAFT_NAME = translate("StartPage", "2D Draft")
65
    T_TEMPLATE_2DDRAFT_DESC = translate("StartPage", "Create a 2D draft with the Draft workbench")
66
    T_TEMPLATE_ARCHITECTURE_NAME = translate("StartPage", "BIM/Architecture")
67
    T_TEMPLATE_ARCHITECTURE_DESC = translate("StartPage", "Create an architecture project")
68
    T_RECENTFILES = translate("StartPage", "Recent files")
69
    T_TIP = translate("StartPage", "Tip")
70
    T_ADJUSTRECENT = translate(
71
        "StartPage",
72
        "Adjust the number of recent files to be shown here in menu Edit -> Preferences -> General -> Size of recent file list",
73
    )
74
    T_EXAMPLES = translate("StartPage", "Examples")
75
    T_GENERALDOCUMENTATION = translate("StartPage", "General documentation")
76
    T_USERHUB = translate("StartPage", "User hub")
77
    T_DESCR_USERHUB = translate(
78
        "StartPage",
79
        "This section contains documentation useful for FreeCAD users in general: a list of all the workbenches, detailed instructions on how to install and use the FreeCAD application, tutorials, and all you need to get started.",
80
    )
81
    T_POWERHUB = translate("StartPage", "Power users hub")
82
    T_DESCR_POWERHUB = translate(
83
        "StartPage",
84
        "This section gathers documentation for advanced users and people interested in writing python scripts. You will also find there a repository of macros, instructions on how to install and use them, and more information about customizing FreeCAD to your specific needs.",
85
    )
86
    T_DEVHUB = translate("StartPage", "Developers hub")
87
    T_DESCR_DEVHUB = translate(
88
        "StartPage",
89
        "This section contains material for developers: How to compile FreeCAD yourself, how the FreeCAD source code is structured + how to navigate in it, how to develop new workbenches and/or embed FreeCAD in your own application.",
90
    )
91
    T_MANUAL = translate("StartPage", "Manual")
92
    T_DESCR_MANUAL = translate(
93
        "StartPage",
94
        'The FreeCAD manual is another, more linear way to present the information contained in this wiki. It is made to be read like a book, and will gently introduce you to many other pages from the hubs above. <a href="https://www.gitbook.com/book/yorikvanhavre/a-freecad-manual/details">e-book versions</a> are also available.',
95
    )
96
    T_WBHELP = translate("StartPage", "Workbenches documentation")
97
    T_DESCR_WBHELP = translate(
98
        "StartPage",
99
        "These are the help pages of all the workbenches currently installed on this computer.",
100
    )
101
    T_COMMUNITYHELP = translate("StartPage", "Getting help from the community")
102
    T_DESCR_COMMUNITYHELP1 = translate(
103
        "StartPage",
104
        'The <a href="https://forum.freecad.org">FreeCAD forum</a> is a great place to get help from other FreeCAD users and developers. The forum has many sections for different types of issues and discussion subjects. If in doubt, post in the more general <a href="https://forum.freecad.org/viewforum.php?f=3">Help on using FreeCAD</a> section.',
105
    )
106
    T_DESCR_COMMUNITYHELP2 = translate(
107
        "StartPage",
108
        'If it is the first time you are posting on the forum, be sure to <a href="https://forum.freecad.org/viewtopic.php?f=3&t=2264">read the guidelines</a> first!',
109
    )
110
    T_DESCR_COMMUNITYHELP3 = translate(
111
        "StartPage",
112
        'FreeCAD also maintains a public <a href="https://www.freecad.org/tracker">bug tracker</a> where anybody can submit bugs and propose new features. To avoid causing extra work and give the best chances to see your bug solved, make sure you read the <a href="https://forum.freecad.org/viewtopic.php?f=3&t=5236">bug submission guide</a> before posting.',
113
    )
114
    T_ADDONS = translate("StartPage", "Available addons")
115
    T_DESCR_ADDONS = translate(
116
        "StartPage",
117
        "Below is a list of available extra workbenches that can be added to your FreeCAD installation. Browse and install them from menu Tools -> Addons manager. You can learn more about any of them by clicking the links below.",
118
    )
119
    T_OFFLINEHELP = translate(
120
        "StartPage",
121
        "If not bundled with your FreeCAD version, install the FreeCAD documentation package to get documentation hubs, workbench help and individual command documentation without an internet connection.",
122
    )
123
    T_OFFLINEPLACEHOLDER = translate(
124
        "StartPage",
125
        'Cannot fetch information from GitHub. <a href="EnableDownload.py">Authorize FreeCAD to access the internet</a> and reload the Start page.',
126
    )
127
    T_RECENTCOMMITS = translate("StartPage", "Recent commits")
128
    T_DESCR_RECENTCOMMITS = translate(
129
        "StartPage",
130
        'Below are the latest changes added to the <a href="http://github.com/FreeCAD/FreeCAD/">FreeCAD source code</a>. These changes might not reflect yet in the FreeCAD version that you are currently running. Check the <a href="https://www.freecad.org/wiki/Downloads">available options</a> if you wish to obtain a development version.',
131
    )
132
    T_SEEONGITHUB = translate("StartPage", "See all commits on github")
133
    T_CUSTOM = translate(
134
        "StartPage",
135
        "You can configure a custom folder to display here in menu Edit -> Preferences -> Start -> Show additional folder",
136
    )
137
    T_VERSION = translate("StartPage", "version")
138
    T_BUILD = translate("StartPage", "build")
139
    T_CREATENEW = translate("StartPage", "Create new...")
140
    T_UNKNOWN = translate("StartPage", "Unknown")
141
    T_FORUM = translate("StartPage", "Forum")
142
    T_DESCR_FORUM = translate(
143
        "StartPage",
144
        'The latest posts on the <a href="https://forum.freecad.org">FreeCAD forum</a>:',
145
    )
146
    T_EXTERNALLINKS = translate(
147
        "StartPage",
148
        "To open any of the links above in your desktop browser, Right-click -> Open in external browser",
149
    )
150
    T_CREATIONDATE = translate("StartPage", "Creation date")
151
    T_LASTMODIFIED = translate("StartPage", "Last modification")
152
    T_SIZE = translate("StartPage", "Size")
153
    T_AUTHOR = translate("StartPage", "Author")
154
    T_LICENSE = translate("StartPage", "License")
155
    T_FILEPATH = translate("StartPage", "File path")
156
    T_NOTES = translate("StartPage", "Notes")
157
    T_VTOOLTIP = translate("StartPage", "Open start page preferences")
158

159
    if handle == "index":
160
        return locals()
161
    elif handle in locals():
162
        return locals()[handle]
163
    return ""
164

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.