-
Notifications
You must be signed in to change notification settings - Fork 47
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
Mac dirs don't use correct APIs to look up names #30
Comments
Hi @lambda, thanks for the report – I assumed that the adaption to the locale was happening at the UI level. Do you have further information on this? |
I can report a similar problem that we currently wrote code to work around
|
Ok, weird. I had assumed that the folder names were translated in the UI layer for user-firendliness, but were not locale-dependent. |
I think it might depend on what locale the system was installed via? but don't quote me on that. As I can safely change my locale while those paths remain the same. |
So what happens to (Is there some config file that stores the paths with which the account was created?) |
I'd have to test, but my understanding is the paths are fixed upon user creation, so if locale is changed later it won't change the paths. But I can do some testing and maybe work on a PR sometime, the big issue for us is ensuring sandboxing doesn't break |
@jfro Would appreciate that! Is there some sys crate for calling |
I'd have to check if it's in any of the foundation crates... our work around we made uses the |
I started on it, first step was the sys crate: dirs-dev/dirs-sys-rs#6 |
I should probably mention that I haven't confirmed what I wrote in the original message; this was not based on a problem I've observed, but my (possibly mistaken) understanding of why there's an API call to retrieve these values, and noticing that they were hardcoded instead of calling that API. So please make sure to confirm that this problem is real! I hope I don't cause people to do extra work for nothing. |
@lambda I'm unable to confirm the locale problem but the sandbox one is real as that has hit me, but that's more of a sandbox homedir vs regular homedir situation. I can ask a co-worker that might be able to check, think there's at least 2 that likely have their systems in non-english from install/purchase. |
According to Apple documentation, "display names" are purely a display layer concern:
|
I'd tend to close this, and if something comes out of the sandboxing issue, create a new issue for that. What do you think? |
On macOS, the names of the various system-created directories like
Library
,Music
, etc can vary based on the user's locale.This crate simply hard-codes paths such as
home_dir().map(|h| h.join("Music"))
, which won't always find the correct directory.Instead, the
NSSearchPathForDirectoriesInDomains
should be used to find the appropriate path to look for.The text was updated successfully, but these errors were encountered: