Add support for page layout settings in builds

This commit is contained in:
Veronica Berglyd Olsen
2023-07-19 23:55:00 +02:00
parent bebf487776
commit ac92e5b126
5 changed files with 283 additions and 51 deletions
+14 -4
View File
@@ -22,16 +22,16 @@ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from __future__ import annotations
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP
from novelwriter.enum import nwBuildFmt, nwItemClass, nwItemLayout, nwOutline
def trConst(tString):
"""Wrapper function for locally translating constants.
"""
return QCoreApplication.translate("Constant", tString)
def trConst(text: str) -> str:
"""Wrapper function for locally translating constants."""
return QCoreApplication.translate("Constant", text)
class nwConst:
@@ -225,6 +225,16 @@ class nwLabels:
nwBuildFmt.J_HTML: ".json",
nwBuildFmt.J_NWD: ".json",
}
UNIT_NAME = {
"mm": QT_TRANSLATE_NOOP("Constant", "Millimetres"),
"cm": QT_TRANSLATE_NOOP("Constant", "Centimetres"),
"in": QT_TRANSLATE_NOOP("Constant", "Inches"),
}
UNIT_SCALE = {
"mm": 1.0,
"cm": 10.0,
"in": 25.4,
}
# END Class nwLabels