mirror of https://github.com/status-im/nimqml.git
Merge pull request #24 from status-im/retranslate
feat: add parameter to make the translation dynamic or not
This commit is contained in:
commit
3a2026ebbc
|
@ -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_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_context(engine: DosQQmlApplicationEngine): DosQQmlContext {.cdecl, dynlib: dynLibName, importc.}
|
||||||
proc dos_qqmlapplicationengine_delete(engine: DosQQmlApplicationEngine) {.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
|
# QVariant
|
||||||
proc dos_qvariant_create(): DosQVariant {.cdecl, dynlib: dynLibName, importc.}
|
proc dos_qvariant_create(): DosQVariant {.cdecl, dynlib: dynLibName, importc.}
|
||||||
|
|
|
@ -29,8 +29,8 @@ proc setRootContextProperty*(self: QQmlApplicationEngine, name: string, value: Q
|
||||||
let context = dos_qqmlapplicationengine_context(self.vptr)
|
let context = dos_qqmlapplicationengine_context(self.vptr)
|
||||||
dos_qqmlcontext_setcontextproperty(context, name.cstring, value.vptr)
|
dos_qqmlcontext_setcontextproperty(context, name.cstring, value.vptr)
|
||||||
|
|
||||||
proc setTranslationPackage*(self: QQmlApplicationEngine, packagePath: string) =
|
proc setTranslationPackage*(self: QQmlApplicationEngine, packagePath: string, shouldRetranslate: bool = true) =
|
||||||
dos_qapplication_load_translation(self.vptr, packagePath.cstring)
|
dos_qapplication_load_translation(self.vptr, packagePath.cstring, shouldRetranslate)
|
||||||
|
|
||||||
proc delete*(self: QQmlApplicationEngine) =
|
proc delete*(self: QQmlApplicationEngine) =
|
||||||
## Delete the given QQmlApplicationEngine
|
## Delete the given QQmlApplicationEngine
|
||||||
|
|
Loading…
Reference in New Issue