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

Certain system messages sent to other users during calculation use the "host" user's language #99

Open
mdziekon opened this issue Apr 8, 2020 · 3 comments
Labels
bug:confirmed All bug reports that were reproduced, therefore confirmed to exist bug All bug reports

Comments

@mdziekon
Copy link
Owner

mdziekon commented Apr 8, 2020

Description

It seems that all system messages (messages displayed using message templates and parameters stored at message creation time) which use statically created parameters using $_LANG suffer from hard-baking message pieces in just one language inherited from "host" user (the user in whom context the calculation is being made). Usually it's not a problem, but some scripts generate messages for other users as well, which might have other languages picked. One such script is Attack mission handler (MissionCaseAttack.php).

Steps to reproduce (example)

  1. Find / create a user which uses different language than yourself
  2. Attack that user
  3. Check the attacked user's new messages (defense report message)

What should happen

  • The message should consist of all pieces in the language picked by the attacked user

What actually happens

  • The message consist of some pieces in the language picked by the attacking user

Regression tracking

Caused by (PR):

  • N/A

Caused by (relevant code pieces):

$Message = false;
$Message['msg_id'] = '075';
$Message['args'] = array($ReportID, $ReportColor2, $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $TargetTypeMsg, $ReportHasHLinkRelative, $ReportHasHLinkReal);
$Message = json_encode($Message);
unset($DefendersIDs[0]);
Cache_Message($DefendersIDs, 0, $FleetRow['fleet_start_time'], 3, '003', '017', $Message);
(one example)

@mdziekon mdziekon added bug:confirmed All bug reports that were reproduced, therefore confirmed to exist bug All bug reports labels Apr 8, 2020
@MickaelRod
Copy link
Contributor

I'm willing to test for French if you like.

@mdziekon
Copy link
Owner Author

mdziekon commented Apr 13, 2020

I'm willing to test for French if you like.

There's no need for that - I already know this will happen using French translation as well. This bug will happen no matter which two different languages are selected by the mentioned two users.

When I first worked on this project it only had just one translation package. Back then, I didn't need any other language, so I must have taken some shortcuts here and there, and this is the result, unfortunatelly.

@MickaelRod
Copy link
Contributor

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed All bug reports that were reproduced, therefore confirmed to exist bug All bug reports
Projects
None yet
Development

No branches or pull requests

2 participants