Bug 370291 - Opening balance account is untranslated
Summary: Opening balance account is untranslated
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.8.0
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks: 370290
  Show dependency treegraph
 
Reported: 2016-10-08 10:21 UTC by Ralf Habacker
Modified: 2019-08-29 15:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.8.1,5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2016-10-08 10:21:45 UTC
Entering account opening balance always creates an account using an untranslated name.


Reproducible: Always

Steps to Reproduce:
1. start kmymoney configured with non english language for example german
2. create a new file using any account template
3. goto to any account, enter an opening balance and save account

Actual Results:  
In the account tree there is a new account below equity root folder named 'Opening balance'

Expected Results:  
The mentioned account should have a translated name
Comment 1 Ralf Habacker 2016-10-09 11:51:50 UTC
The root cause is located in mymoneyfile.cpp:56 were the following definition 

const QString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances");

defines a translation, but does not really translate it.
Comment 2 Ralf Habacker 2017-05-25 11:04:49 UTC
Changing 

const QString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances");

to 

const QString MyMoneyFile::OpeningBalancesPrefix = i18n("Opening Balances");

do not solve the problem, because i18n context seems not to be defined on that initialization stage. There is a refactoring of the related code required.
Comment 3 Ralf Habacker 2017-05-25 12:21:10 UTC
Git commit 439f01b5fb53ad16950fda026960a5783d6fbfb7 by Ralf Habacker.
Committed on 25/05/2017 at 12:18.
Pushed by habacker into branch '4.8'.

Fix 'Opening balance account is untranslated'.

Using i18n for assigning a static variable does not work; therefore
OpeningBalancesPrefix has been refactored into a static class method
which is called on demand.
FIXED-IN:4.8.1

M  +7    -3    kmymoney/mymoney/mymoneyfile.cpp
M  +4    -4    kmymoney/mymoney/mymoneyfile.h
M  +2    -2    kmymoney/mymoney/mymoneyfiletest.cpp

https://commits.kde.org/kmymoney/439f01b5fb53ad16950fda026960a5783d6fbfb7