Comments (2)
Thanks for pointing this out and also providing a solution. If it did this and the person has a non English time locale, the text representation of the date would be incorrect? I suppose there is a general solution for this.
from gource.
Here's an example of using strftime with different locales on an online Visual C++ compiler: http://rextester.com/CZTQY99923
Source:
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
char str[200];
time_t currTime = time(NULL);
// Default locale
strftime(str, sizeof(str), "%#x", localtime(&currTime));
cout << "Default \"C\" Locale (Implicitly-set): " << str << endl;
// setlocale "C" should also be the Default locale
setlocale(LC_ALL, "C");
strftime(str, sizeof(str), "%#x", localtime(&currTime));
cout << "Default \"C\" Locale (Explicitly-set): " << str << endl;
// setlocale "" should be the user's system locale
setlocale(LC_ALL, "");
strftime(str, sizeof(str), "%#x", localtime(&currTime));
cout << "User/System Locale: " << str << endl;
// setlocale "lang-COUNTRY" should set that specific locale
setlocale(LC_ALL, "es-ES");
strftime(str, sizeof(str), "%#x", localtime(&currTime));
cout << "Spanish (Spain) locale: " << str << endl;
}
Here's the output I get from that site currently:
Default "C" Locale (Implicitly-set): Saturday, April 22, 2017
Default "C" Locale (Explicitly-set): Saturday, April 22, 2017
User/System Locale: Samstag, 22. April 2017
Spanish (Spain) locale: s�bado, 22 22e abril 22e 2017
(this last line appears to be bugged for some reason, possibly the online compiler is running on a system that's missing some bugfix)
The User/System Locale in the output (3rd line) is from the system that's compiling and running that code, which appears to be German.
So at the moment if the user had a non-English system, Gource would still output time as the default "C" format (the first line in the output), which is based on U.S. English.
I think the default behaviour for Gource should be to use the "" locale so it matches the user's system/profile (and have this set pretty early on when the process starts). There could optionally be a command line option to override the default locale, like --locale "en-GB"
, with that value passed directly to setlocale
(so documentation would need to point out that locales are provided by the system, and different systems have different locale support).
from gource.
Related Issues (20)
- [Feature Request] Show simultainiusly Developer Count while Video is running.
- Can't use REGEX in windows powershell HOT 1
- usage for video HOT 1
- How to always show directory names HOT 2
- Unable to start on Wayland session
- Advanced Styling and related bugs
- using gource to map pretty network graphs
- has gravatar changed their api?
- Title and Key collision
- Documentation: document data privacy aspects of using gource
- Link to http://opengroup.org/onlinepubs/007908799/xsh/strftime.html no longer works
- gource as a reference for an evolutionary dataset generation framework from codebases
- feature request: ignoring a particular folder HOT 3
- Update wiki to reflect custom log format ISO 8601 timestamps HOT 1
- README doc seems to be incorrect. Plus/minus don't adjust simulation speed, they zoom in/out. HOT 1
- Update wiki for merging multiple repositories in Windows
- build failed HOT 2
- Install failed on M1, error: use of undeclared identifier 'extension' HOT 1
- "--date-format" options doesn't work
- Piping to ffmpeg throws ERROR failed to run: capacity was less than the current size. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gource.