Skip to content

Added fr-ch localisation#207

Closed
mrzhdev wants to merge 0 commit intolg2de:mainfrom
mrzhdev:main
Closed

Added fr-ch localisation#207
mrzhdev wants to merge 0 commit intolg2de:mainfrom
mrzhdev:main

Conversation

@mrzhdev
Copy link
Copy Markdown
Contributor

@mrzhdev mrzhdev commented Nov 8, 2022

Added Swiss french localisation with translations

Description

Added Swiss French localization with translations.
Used Zeta Resource Editor and related files are available upon request.
Probably the naming conventions are not perfect, as I am not an accountant either.

Related issue

None.

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 9, 2022

Hey @mrzhdev, I'm really happy that you want to contribute. Seams it is useful for you.

I think, Swiss French is a quite specific version, isn't it?
For me it would not be possible to verify or maintain the French localization in future, even less the Swiss version.

I would like to ask you whether you could contribute the generic French version?
This one I could maintain roughly use automatic translation.
The verification, even more the accountant correct verification, should be done by native speakers.

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 10, 2022 via email

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 11, 2022

The currency should be configurable in the project. It must not be derived from the culture settings.
This an issue which should be tracked separately.
It it is (fully) part of the resources (I've not checked that), then this is a bug.

The decimal separator should come from culture. This information is already in and should not be configured.
To reduce the effort and maximize the effect we can

  1. Rename Resources.fr-ch.resx to Resources.fr.resx and update if needed.
  2. Add "fr" and "fr-ch" to the culture selector. If "fr-ch" is selected the "resource culture fr" should be used together with the "ui culture fr-ch" (to get the dot as decimal separator).

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 11, 2022

With #127 we have already an issue for the currency configuration feature.

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 11, 2022 via email

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 11, 2022

Yes, this was my fault - due to simplification for my so-far-use-cases.
Please just switch to "fr" only. You can also leave "CHF" for now.
I'll take care configuration of currency in the project incl. updating this resource.

@lg2de lg2de mentioned this pull request Nov 13, 2022
<value>Numéro de journalisation</value>
</data>
<data name="Label_ValueWithCurrency" xml:space="preserve">
<value>Valeur (CHF)</value>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<value>Valeur (CHF)</value>
<value>Valeur ({0})</value>

<data name="Word_BookingNumber" xml:space="preserve">
<value>Numéro de journalisation</value>
</data>
<data name="Label_ValueWithCurrency" xml:space="preserve">
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<data name="Label_ValueWithCurrency" xml:space="preserve">
<data name="Label_ValueWithCurrencyX" xml:space="preserve">

<data name="AccountConfiguration_IgnorePatternDescription" xml:space="preserve">
<value>Expression régulière utilisée pour supprimer des sous-chaînes</value>
</data>
</root> No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</root>
<data name="Word_Currency" xml:space="preserve">
<value>Currency</value>
</data>
<data name="Menu_Project_Settings_ProjectOptions" xml:space="preserve">
<value>Options du projet</value>
</data>
<data name="Header_ProjectOptions" xml:space="preserve">
<value>Modifier les options du projet</value>
</data>
</root>

ICommand SwitchCultureCommand { get; }
bool IsGermanCulture { get; }
bool IsEnglishCulture { get; }
bool IsSwissFrenchCulture { get; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool IsSwissFrenchCulture { get; }
bool IsFrenchCulture { get; }
bool IsSwissFrenchCulture { get; }

this.projectData.Settings.Culture = cultureName.ToString();
this.NotifyOfPropertyChange(nameof(this.IsGermanCulture));
this.NotifyOfPropertyChange(nameof(this.IsEnglishCulture));
this.NotifyOfPropertyChange(nameof(this.IsSwissFrenchCulture));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.NotifyOfPropertyChange(nameof(this.IsSwissFrenchCulture));
this.NotifyOfPropertyChange(nameof(this.IsFrenchCulture));
this.NotifyOfPropertyChange(nameof(this.IsSwissFrenchCulture));


public bool IsGermanCulture => this.projectData.Settings.Culture == "de";
public bool IsEnglishCulture => this.projectData.Settings.Culture == "en";
public bool IsSwissFrenchCulture => this.projectData.Settings.Culture == "fr-CH";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public bool IsSwissFrenchCulture => this.projectData.Settings.Culture == "fr-CH";
public bool IsFrenchCulture => this.projectData.Settings.Culture == "fr";
public bool IsSwissFrenchCulture => this.projectData.Settings.Culture == "fr-CH";

IsCheckable="True" IsChecked="{Binding Menu.IsGermanCulture, Mode=OneWay}" />
<MenuItem Header="English" Command="{Binding Menu.SwitchCultureCommand}" CommandParameter="en"
IsCheckable="True" IsChecked="{Binding Menu.IsEnglishCulture, Mode=OneWay}" />
<MenuItem Header="SwissFrench" Command="{Binding Menu.SwitchCultureCommand}" CommandParameter="fr-CH"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<MenuItem Header="SwissFrench" Command="{Binding Menu.SwitchCultureCommand}" CommandParameter="fr-CH"
<MenuItem Header="Français" Command="{Binding Menu.SwitchCultureCommand}" CommandParameter="fr"
IsCheckable="True" IsChecked="{Binding Menu.IsFrenchCulture, Mode=OneWay}" />
<MenuItem Header="Français suisse" Command="{Binding Menu.SwitchCultureCommand}" CommandParameter="fr-CH"

icon: MessageBoxImage.Information);
sut.IsGermanCulture.Should().BeFalse();
sut.IsEnglishCulture.Should().BeFalse();
sut.IsSwissFrenchCulture.Should().BeFalse();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sut.IsSwissFrenchCulture.Should().BeFalse();
sut.IsFrenchCulture.Should().BeFalse();
sut.IsSwissFrenchCulture.Should().BeFalse();

@@ -0,0 +1,570 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the file to Resources.fr.resx

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 14, 2022 via email

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 14, 2022

I have made a new push.

Why you did not took my suggestions?

  1. We can use both, french and french swiss, isn't it? Or are the differences that much?
  2. You must update the resources according to my recent feature update to CONFIGURE the currency.

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 14, 2022 via email

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 14, 2022 via email

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 15, 2022

I guess we should start again from the beginning...
You want to have French (swiss) localization and French swiss currency printing.
I learned meanwhile that "French swiss" is the one and only area where we have a difference in number formatting (.) and currency formatting (,), correct.
This means I/we need not only to change the available cultures or resources, but also all occurrences for currency formatting. This is quite big effort. But I think it should be correct.

I introduced manual culture selection because I faced some situations where automatic detection (system culture) was not the desired result.
But when I start selecting the culture I would like be consistent. So I do not like to decouple these settings.

I think with your initial commit and my suggestions we are quite close to the correct solution for you. Then we "only" need to change "all the currency formatting". (This I would like to handle in a different PR.)

If you still want to contribute this feature, please

  1. create a new PR with your initial commit (I recommend to use a branch in your repository too)
  2. rebase it on my main
  3. Apply the suggesions above (just provide French - without "swiss")

If your computer is configured to "French swiss" SimpleAccounting with the "" selection should automatically show the "French" localization and use the French swiss formatting.

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 16, 2022 via email

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 16, 2022 via email

@lg2de
Copy link
Copy Markdown
Owner

lg2de commented Nov 17, 2022

I don't want to miss your localization.
Therefore I created a new PR based on your work (cherry-pick).
Please review #213.

Further I understand what you want to change to archive correct visualization of overwritten regional settings.
A PR is welcome. Otherwise we should track this as an issue and I'll take care later.

Please note that - as stated before - we should also switch from "number formatting" to "currency formatting" to be fully correct in "swiss french" localization.

@mrzhdev
Copy link
Copy Markdown
Contributor Author

mrzhdev commented Nov 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants