Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Translation: duplicated string
Forum Updated to NodeBB v4.3 + New Features

Translation: duplicated string

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 423 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    Hi,
    In three qml files I have this string: qsTr("OK").

    When I run lupdate I get three duplicated "OK" strings to translate.

    How to tell lupdate not to duplicate same strings?

    Thanks

    KazuoAsanoK 1 Reply Last reply
    0
    • M MartinD

      Hi,
      In three qml files I have this string: qsTr("OK").

      When I run lupdate I get three duplicated "OK" strings to translate.

      How to tell lupdate not to duplicate same strings?

      Thanks

      KazuoAsanoK Offline
      KazuoAsanoK Offline
      KazuoAsano
      Qt Champions 2018
      wrote on last edited by
      #2

      @MartinD,

      In three qml files I have this string: qsTr("OK").

      It's recognized as a different translation target.
      If you want to have one target, what about implementing as Original QML Type?
      For Example as below

      TypeDef.qml

      import QtQuick 2.12
      
      Item {
          property string ok_string :  qsTr("OK")
      }
      

      Sample.qml

      import QtQuick 2.12
      
      Item {
          id: root_
      
          TypeDef { id: def_ }    /// define QML Type( include OK string)
      
          Text {
              text: def_.ok_string
          }
      }
      
      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved