From 53d89149f3cafbe7d7b507bdfcba2544ff091ede Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 28 Jul 2021 13:36:55 -0400 Subject: [PATCH] feat: add parameter to make the translation dynamic or not --- src/nimqml/private/dotherside.nim | 2 +- src/nimqml/private/qqmlapplicationengine.nim | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nimqml/private/dotherside.nim b/src/nimqml/private/dotherside.nim index 59ea3bb..2beb56a 100644 --- a/src/nimqml/private/dotherside.nim +++ b/src/nimqml/private/dotherside.nim @@ -158,7 +158,7 @@ proc dos_qqmlapplicationengine_load_data(engine: DosQQmlApplicationEngine, data: proc dos_qqmlapplicationengine_add_import_path(engine: DosQQmlApplicationEngine, path: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qqmlapplicationengine_context(engine: DosQQmlApplicationEngine): DosQQmlContext {.cdecl, dynlib: dynLibName, importc.} proc dos_qqmlapplicationengine_delete(engine: DosQQmlApplicationEngine) {.cdecl, dynlib: dynLibName, importc.} -proc dos_qapplication_load_translation(engine: DosQQmlApplicationEngine, content: cstring) {.cdecl, dynlib: dynLibName, importc.} +proc dos_qapplication_load_translation(engine: DosQQmlApplicationEngine, content: cstring, shouldRetranslate: bool) {.cdecl, dynlib: dynLibName, importc.} # QVariant proc dos_qvariant_create(): DosQVariant {.cdecl, dynlib: dynLibName, importc.} diff --git a/src/nimqml/private/qqmlapplicationengine.nim b/src/nimqml/private/qqmlapplicationengine.nim index 3247a78..d8206c1 100644 --- a/src/nimqml/private/qqmlapplicationengine.nim +++ b/src/nimqml/private/qqmlapplicationengine.nim @@ -29,8 +29,8 @@ proc setRootContextProperty*(self: QQmlApplicationEngine, name: string, value: Q let context = dos_qqmlapplicationengine_context(self.vptr) dos_qqmlcontext_setcontextproperty(context, name.cstring, value.vptr) -proc setTranslationPackage*(self: QQmlApplicationEngine, packagePath: string) = - dos_qapplication_load_translation(self.vptr, packagePath.cstring) +proc setTranslationPackage*(self: QQmlApplicationEngine, packagePath: string, shouldRetranslate: bool = true) = + dos_qapplication_load_translation(self.vptr, packagePath.cstring, shouldRetranslate) proc delete*(self: QQmlApplicationEngine) = ## Delete the given QQmlApplicationEngine