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

Doesn't work with other locale than english #1

Open
intelligence opened this issue Jan 8, 2014 · 1 comment
Open

Doesn't work with other locale than english #1

intelligence opened this issue Jan 8, 2014 · 1 comment

Comments

@intelligence
Copy link

Hello!

Tried to get this working on my Mac running OSX in swedish but it seems it doesn't pick up the correct file as it says "Skärmavbildning" in the beginning of the file, rather than Screenshot.

@dergachev
Copy link
Owner

Hi @intelligence,

Good point, didn't really think of non-English setups. Unfortunately I can't think of an simple way to support the general use case, and at this point the script works well enough for me that I can't justify spending a couple of hours on it.

That said, there's no reason you shouldn't be able to get it to work well enough for you in a couple of minutes.

Start by modifying the following line in the main script file:
https://github.com/dergachev/dropbox-screenshots/blob/master/dropbox-screenshots#L31

# Screen Shot 2013-11-01 at 3.10.13 PM.png
time = orig_filename.scan(/Screen Shot (.*) at (.*).png/).first

You'll need to change the regular expression in that line to match your file names.
Also you probably have a different default time/date format than I do, so you'll need to also change this line:
https://github.com/dergachev/dropbox-screenshots/blob/master/dropbox-screenshots#L40

time = Time.parse(time).strftime("%Y.%m.%d-%H-%M-%S")

See http://www.ruby-doc.org/core-2.1.0/Time.html#method-i-strftime for the list of formatters to use.

If you succeed, please post a diff (generated by git diff) in this issue for others to learn from.

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

No branches or pull requests

2 participants