Headless app does not dynamically

I have a problem with our application without a head.

We have three actions of hub like this:

int retVal = _udsUtil->addAccountAction(_accountId, QString("bb.action.COMPOSE"), QString(tr("Compose")),
        _cardTarget, QString("application"), _itemComposeIconFilename, _itemMimeType, UDS_PLACEMENT_SIGNATURE);
if (retVal != 0) {
    qDebug() << "HubAccount::initialize: addAccountActionData: bb.action.COMPOSE : " << " retval: " << retVal;
}

As part of the application without a head, we a TranslationService which is initialized like this:

TranslationService::TranslationService() :
    QObject(),
    m_translator(new QTranslator(this)),
    m_bpsHandler(new BpsHandler())
{
    connect(m_bpsHandler, SIGNAL(localeUpdated(QString)), this, SLOT(onSystemLanguageChanged(QString)));
    onSystemLanguageChanged(QLocale().name());
}

It connects the signal with this machine localeUpdated slot:

void TranslationService::onSystemLanguageChanged(QString newLocale)
{
    qDebug() << "TranslationService::onSystemLanguageChanged()" << newLocale;
    QCoreApplication::instance()->removeTranslator(m_translator);

    // Append the locale code (ie: en_US, fr_FR, etc)
    QString file_name = QString("appheadless_%1").arg(newLocale);
    qDebug() << "File name:" << file_name;

    if (m_translator->load(file_name, "app/native/qm")) {
        qDebug() << "File loaded successfully";
        QCoreApplication::instance()->installTranslator(m_translator);
    }
}

There is an appheadless.qm and appheadless_de.qm file in the appropriate directory (app/native/qm) which I checked with the target file system browser.

When I install the application with the locale OF the action is properly translated in German, but when I switch to English, it remains that way - and vice versa (English installation, string rest in English)

The output log file States:

08.06.2016, 15:20:41.330 TranslationService Debug:nSystemLanguageChanged() 'en_US '.
08.06.2016, 15:20:41.353 Debug file name: "appheadless_en_GB."
08.06.2016, 15:20:41.427 debug successfully loaded file
08.06.2016, 15:20:47.556 TranslationService Debug:nSystemLanguageChanged() 'de_DE '.
08.06.2016, 15:20:47.565 Debug file name: "appheadless_de_DE."
08.06.2016, 15:20:47.590 debug successfully loaded file

in the meantime, I look into the hub and action again message does not change its channel

The problem isn't your TranslationService.

When you addAccountAction(), your string is translated for the locale at the moment. There is no such thing as Retranslate.onLocaleOrLanguageChanged in C++, but @greenmr did a great how-to article on how to do it! Check it out here: https://supportforums.blackberry.com/t5/Native-Development/HOWTO-Live-translation-in-C-similar-to-Re...

I have never worked with UDS myself, maybe his solution will not work with stock account Hub, you can try it for yourself.

Another simple solution would be to call _udsUtil-> updateAccountAction() whenever onSystemLanguageChanged() is called, that would translate the text updated using local news.

Tags: BlackBerry Developers

Similar Questions

  • As I installed the latest OS 10.0.1 on my iPhone, the Pandora app does not work.

    As I installed the latest OS 10.0.1 on my iPhone, the Pandora app does not work.

    Have you installed the latest update of Pandora (version 7.6), posted on September 13, 2016?

  • As it can be seen in the OS 3 Web page will be available today, 13 September. However my Watch App does not seem to see the update according to the availability. When I go to software update, he repeats that my watch is up-to-date with OS 2.2.2. OS3 will

    As it can be seen in the OS 3 Web page will be available today, 13 September. However my Watch App does not seem to see the update according to the availability. When I go to software update, he repeats that my watch is up-to-date with OS 2.2.2. OS3 will be available today?

    Hello

    Yes - Apple advises that watch OS 3 is scheduled to be released sometime today.

  • mail app does not work in a single user

    mail app does not work on my mac for a single user... What do I do?

    Indicates the connection doctor?

    Mail > window > connection doctor

  • Professional information package launched by mistake on my Mac. Since then, the computer is out of order.  The app is always open to the dock, but cannot close or force quit it. Power button doesn, t make a stop. Computer is NOT frozen, but apps does not

    Professional information file on my Mac. Since then, the computer is out of order.  App always opens in the dock, but cannot close or force quit it. Start button / stop is not make a judgment. Computer is NOT frozen, but apps does not open. Cannot shut down, restart, or use something else! Help!

    If you hold the button power for more than 10 seconds, it will not shut the MBP?

    Try a SMC reset:

    https://support.Apple.com/en-us/HT201295

    Ciao.

  • Mail.app does not properly display emails

    Mail.app does not display emails correctly, the text is not formatted, e-mails are displayed without text and attachments. At the same time these emails are displayed correctly when opened in the Mail app on iPhone or web browser.

    Below are examples.

    Please tell us how to fix this problem.

    This procedure is a diagnostic test. It makes no changes to your data.

    Please triple - click anywhere in the line below on this page to select:

    defaults read -app Mail PreferPlainText | pbcopy

    Copy the selected text in the Clipboard by pressing Control-C key combination.

    Launch the Terminal application integrated in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Paste in the Terminal window by pressing the command-V key combination. I tested these instructions only with the Safari browser. If you use another browser, you may need to press the return key after pasting.

    Wait for a new line ending with a dollar sign ($) below what you entered.

    The output of the command will be automatically copied to the Clipboard. If the command produces no output, the Clipboard is empty. Paste into a reply to this message.

    The Terminal window does not display the output. Please do not copy from there.

  • The top of page 1 1/4 inch has no answer whin you click on it. As in this page, sign in or register and other app does not work. in English

    The top of page 1 1/4 inch has no response when you click it. As in this page, sign in or register and other app does not work. in English

    This problem can be caused by that extended the Yahoo! toolbar or extension of Babylon also well down and covers the top of the browser window and therefore links and buttons in this part of the screen not clickable.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • iPhone 6 s think is store songs, but the music app does not work

    I've upgraded to an iPhone 6s, and I restored it to my backup so that all my contacts on my phone.

    I do not keep the music on my phone because it takes place, and I can just listen to my library of music to iCloud. However, each song that I play, my phone displays I'll keep the songs on my phone, but the music app always said that I don't have any songs downloaded on my phone. I'm especially worried about it because I had a problem with my previous phone where I didn't keep all the music on my phone, but for some reason any much space was taken over on my phone. I fear that my phone will fill with songs, but not recognize them (which can be irrational, but who knows). In any case, here are a few screenshots to show you what I'm talking about is about, what happens to someone else?

    1. you can see it says there are "59 songs" on my phone

    2. when I go to music app and search for downloaded music...

    3. it's screen (which indicates that I did not download the music on my phone)

    4. after a few minutes of songs, has increased the number of "Songs on my iphone..."

    ... And when I go to the "manage storage" section in the settings, the music app does not appear as an application that takes place (because apparently there isn't any music inside)

    I'm worrying needlessly, or is my phone slyly fills with music?

    So I discovered that after turning off "iCloud music library" under the "Music" tab in the settings, it displays much fewer songs on the 'About' page (although I still have none), and it showed that I had more than about 1 GB of storage space. So, I concluded that indeed, while I listen to music from my library iCloud, he should secretly Store songs on my phone (and perhaps easier streaming later?), and turn off streaming iCloud removes these songs. This is exactly what I wanted to know, but at least I can the hypothesis a little more on what iCloud music is streaming.

  • iPhone 6 s - photo app does not allow users to take pictures and listen to music at the same time

    The repro steps:

    • iPhone 6 s - photo app does not allow the user to take pictures and listen to music at the same time

      Music app vs photo app

    (1) play a sound track in the music app
    (2) the swtich to app photo (on the "Photo" mode)
    (3) music stops

    Pandora app vs photo app

    1) turn on pandora
    2) switch to the camera on the 6s iphone app
    (3) stopping the music

    PLEASE FIX AS SOON AS POSSIBLE *.

    My iPhone stopped playing music when you take photos?

    Nothing to trouble since he was not taken in charge.

  • I get download error messages, could not be opened beak helper app does not exist, chg association suggestions - what to do?

    I get - download error - / Users/ffrasher / / Desktop/Firefps
    3.6.13.dmg could not be opened, because the associated helper app does not exist. Changing the association in your preferences. I run MOSX 1.3.9 Firefox 2.0.0.20. What I can do to upgrade.

    Frank

    See:

  • videos app does not show me movies and TV shows, that I recently bought.

    Hi all, I have a problem with my iPhone 6 s, the problem is that the videos app does not show me movies and TV shows, I bought a few hours ago, and I realize that my iPhone 4S has not this problem. Both have installed the latest versions of ios.

    Don't show them where? In the video application itself? Tab in iTunes purchased? If they are not downloaded, go to settings > videos > show iTunes purchases > on.

  • I keep seeing pop up ads powered by '' cn tatami '' whenever I have to navigate using Safari or open a link on the FB Adblocker app does not work for this. Any suggestions? There is no option to cross the pop-up ad that it redirects to various Web sites.

    I keep seeing pop up ads powered by '' cn tatami '' whenever I have to navigate using Safari or open a link on the FB Adblocker app does not work for this. Any suggestions? There is no option to cross the pop-up ad that it redirects to various Web sites.

    Cache and history of the site Clear settings - Safari -.

    (1232)

  • Podcasts App does not work in the new mini iPad 2

    The Podcasts app does not work on my new iPad mini 2.  All other applications work OK. Typed on the results of the icon in an almost empty screen, with just a few shaded options along the bottom that do nothing.  There is a sign more in the upper left corner, tapping brings up the URL of the podcast application.

    I wonder if I should delete and reinstall the App (how?)

    Robin

    Well, the old farm and restart thing seems to have fixed.  Should try it before I posted.

    Robin

  • Calendar app does not work after soft. upgd.

    I have a Motorola Fire XT, and recently updated the software with Motorola Software Update application. It updated my Android phone 2.3.5 but after that I noticed that calendar app does not work, he said : "the application calendar (process.com.android.calendar) has stopped unexpectedly. Please try again. " and asked to force close. I tried several times, in vain. How can I solve the problem?

    I have also faced the same problem after update.

    Support staff recommended I reset the phone to factory settings.

    It worked. But I had to reinstall many applications.

    But take backup of phonebook, messages, and other data.

  • Yoga 15 500 MICI - Dolby digital app does not work

    I improve my SDS HARD drive and reinstall Windows 10 and install it manually download Lenovo driver Realtek but Dolby digital plus app does not work? Model 500 15 DCI Yoga

    Comment to Moderator: The model is added to the object for clarity.

    I found a solution, if someone face same issue:
    Downloads of the latest drivers updates catalogs Microsoft

Maybe you are looking for