Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categories translation #4418

Closed
vomikan opened this issue May 19, 2022 · 18 comments
Closed

Categories translation #4418

vomikan opened this issue May 19, 2022 · 18 comments
Assignees
Milestone

Comments

@vomikan
Copy link
Member

vomikan commented May 19, 2022

All categories are subject to translation. But in the categories dialog, when you enable any language other than English, all categories are displayed without translation.

image

db/DB_Table_Category_V1.h:117

image

Moreover, if this is corrected, there may be a conflict with the algorithm for saving the transaction filter settings. Although not a fact.

@vomikan vomikan added the bug label May 19, 2022
@vomikan vomikan added this to the v1.5.15 milestone May 19, 2022
@whalley
Copy link
Member

whalley commented May 20, 2022

@vomikan Didn't we cover this here: #3724

Category and subcategory names should only be translated ONCE when the tables are first created.

@vomikan
Copy link
Member Author

vomikan commented May 20, 2022

Category and subcategory names should only be translated ONCE when the tables are first created.

Yes, I thought so too, but Lisheng insisted on translating categories. Now, I'm leaning towards that opinion too.

Category and subcategory names should only be translated ONCE when the tables are first created.

And that doesn't work either. I have an OS with an English interface. Initially, when mmex is launched, there is no way to select a language. We have to create an empty database. After that, it is possible to switch the language. Finally, you can create a database for the selected language. But the categories turn out to be without translation.

@whalley
Copy link
Member

whalley commented May 20, 2022

I don't like the idea of potentially changing, based on translation, something that a user can edit. Perhaps at first start we pop a dialog saying "Do you want to create a default set of categories" if the user says YES then ask what language to use?

@vomikan
Copy link
Member Author

vomikan commented May 20, 2022

There is an option, it seems to me, simpler. Add a language selection at the start of the application and create categories according to the selected language.

image

@whalley
Copy link
Member

whalley commented May 20, 2022

Yep seems a good suggestion.

@whalley whalley self-assigned this May 21, 2022
@whalley
Copy link
Member

whalley commented May 21, 2022

Have added the option to change language at startup. However, I can't seem to get categories created in the required language when I create the DB? Am I doing something odd here?

vomikan added a commit that referenced this issue May 21, 2022
fix(#4418): change language at startup
@vomikan
Copy link
Member Author

vomikan commented May 21, 2022

There is no translation of categories when inserted into the database. The idea of translating categories at the UI level won earlier.

@whalley
Copy link
Member

whalley commented May 21, 2022

Oh, thought I saw it in the DB code!

@vomikan
Copy link
Member Author

vomikan commented May 21, 2022

Oh, thought I saw it in the DB code!

https://github.com/moneymanagerex/moneymanagerex/blob/master/src/db/DB_Table_Category_V1.h#L111-L126

wxTRANSLATE does not translate the string. Do not confuse it with _(...) and wxGetTranslation(...)

The Python script util/sqlite2cpp generates this code. In it, you need to replace wxTRANSLATE with _.

vomikan added a commit to vomikan/moneymanagerex that referenced this issue May 21, 2022
@vomikan vomikan added the fixed label May 21, 2022
@whalley
Copy link
Member

whalley commented May 22, 2022

wxTRANSLATE does not translate the string. Do not confuse it with _(...) and wxGetTranslation(...)

Yep, that was what clouded my mind.

vomikan added a commit to vomikan/moneymanagerex that referenced this issue May 22, 2022
@whalley
Copy link
Member

whalley commented May 22, 2022

@vomikan I also noticed when I ran the python script (was going to update the repo held src/db files before your above commit :-) ) that BD_Table_Currenyformats also had wxTRANSLATE for the currency names that is also now changed. Are your files hand-edited? Any reason why the Currencyformats have been excluded?

I see the appveyor/travis scripts always rebuild these files. (I think it would be good to update these to python3 compatible scripts at some point).

@vomikan
Copy link
Member Author

vomikan commented May 22, 2022

@whalley I didn't use the script. It works correctly, but generates another file. I did not deal with this problem. Because the build is not done automatically for MAC, then you can leave a manual fix.

@vomikan
Copy link
Member Author

vomikan commented May 22, 2022

I think it would be good to update these to python3

I think it's worth doing this.

@vomikan
Copy link
Member Author

vomikan commented May 22, 2022

@whalley I think it's better to do everything with a script. Was there a conflict after I changed the file manually?

@vomikan vomikan removed the fixed label May 22, 2022
@whalley
Copy link
Member

whalley commented May 22, 2022

There was no 'conflict' it was just that you had not manually updated the 'BD_Table_Currenyformats.h' file. I did regenerate everything from the script. it is just that for people who check out the code and build manually we need to keep the header files updated and hence run the script after we make changes and commit - that is all I did.

If we force everyone to use a script then we should remove the generated headers from the repo, otherwise, we need to re-generate when we make a change that affects them.

@vomikan
Copy link
Member Author

vomikan commented May 22, 2022

I would prefer not to change the file with currencies. We will never wait for translations even in the most translated languages.
Can you rewrite the script to exclude the processing of the file with currencies?

db->ExecuteUpdate(wxString::Format("INSERT INTO CURRENCYFORMATS_V1 VALUES ('1', '%s', '$', '', '.', ' ', '', '', '100', '1', 'USD')", _("United States dollar"))); <- should be wxTRANSLATE("United States dollar")

#1528 #739

UPDATE
All of the above does not matter. The file is excluded from translations.
image

@whalley
Copy link
Member

whalley commented May 22, 2022

@vomikan Should I create a pull request of this - whalley@192ae05
or just ditch it?

@vomikan
Copy link
Member Author

vomikan commented May 22, 2022

Should I create a pull request of this - whalley@192ae05

Yes, please

@whalley whalley added the fixed label May 22, 2022
whalley pushed a commit that referenced this issue May 22, 2022
fix(#4418): rebuild from python script
@vomikan vomikan closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants