Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ugrade hardcoded new language String #4889
Forum version: SMF 2.1 Beta 4 (more detailed)
I have update my german language strings, but one Text is not translatet:
The string seems to exist:
Actually this would be harder to achieve. If you change the line to:
You'll get the first part localized, so translator may translate "Completed in" but not totalTime, because of this:
We could translate "hour", "minute" and "second" but they add an aditional s at the end if the variable is higher than 1, so I don't know what would be the best approach here. Thoughts?
So leaving like that should work? Try adding a new text string that only contains "Completed in" in German and then place it in the line I pasted above. As I don't have any language packs installed I can't properly test it, so if you can say if that works, that'd be great.
referenced this issue
Aug 8, 2018
EDIT: Looking at the code we have diffMinutes and diffSeconds, even diffHours (seems a bit extreme though, but okay). We could use two strings, 'completed_in_with_hours' and 'completed_in' or something, with 'Completed in %d hours, %d minutes and %d seconds' and 'Completed in %d minutes and %d seconds' respectively.
Ok, I think this should be changed as follows.
There is 2 places this occurs in, one is in debug mode after the db upgrade is done. The second one is at the very end.
The debug mode one, we can let it be a little more simple, as its mainly used for development purposes to understand how long the database upgrade part took (actually time from start till db upgrader finished actually).
That language string becomes:
That code becomes:
The second one needs to be a bit more friendly since it is intended for general upgrades to know how long the entire process took.
So those language strings
And that code becomes:
I think this gets us what we need. There isn't a elegant way without adding a 4th string to do hours without minutes but have seconds, or just minutes. I think it will be best to accept it saying 0 seconds or 0 minutes in those cases. Otherwise we will have to add more language strings to make things "correct".
We could also format the time as HH:MM:SS and say it like "Upgrade completed in 02:32:16". Looks a bit weird but simple language handling then.
I flipped around the 2 codes, but the concept still applies. The db one is the one we actually always show, the end upgrader one is the one only for debug mode.