You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Languages and file paths

I have an AppleScript which I would like to work regardless of the user's system language. I imagine that folder names are different depending on the language, i.e. /Applications vs. /Aplicaciones. I know for that particular example, I could just say "path to applications folder," but that won't always work. So my question is whether or not there is an easy way to get any file path regardless of language, or perhaps convert it somehow? And if so, what is it?

Posted on Dec 15, 2015 10:49 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 16, 2015 7:24 AM

File system path is independent of localisations. E.g., /Library is always referred to by /Library regardless of the current locale.


If you want to get localised folder name in current locale, it is another problem and you'd need to query the following strings table:


/System/Library/CoreServices/SystemFolderLocalizations/*.lproj/SystemFolderLocalizations.strings



by means of "localized string" command, such as -



(* Localised folder names are defined in - /System/Library/CoreServices/SystemFolderLocalizations/*.lproj/SystemFolderLocalizations.strings *) set locs to "/System/Library/CoreServices/SystemFolderLocalizations" localized string "Library" from table "SystemFolderLocalizations" in bundle (locs as POSIX file) (* => "Bibliothèque" if current locale is Français => "Library" if current locale is English * Note that current locale is the locale set when the current application is initialized, e.g., when the Script Editor is launched. *)




Regards,

H

2 replies
Question marked as Top-ranking reply

Dec 16, 2015 7:24 AM in response to stevejobsfan0123

File system path is independent of localisations. E.g., /Library is always referred to by /Library regardless of the current locale.


If you want to get localised folder name in current locale, it is another problem and you'd need to query the following strings table:


/System/Library/CoreServices/SystemFolderLocalizations/*.lproj/SystemFolderLocalizations.strings



by means of "localized string" command, such as -



(* Localised folder names are defined in - /System/Library/CoreServices/SystemFolderLocalizations/*.lproj/SystemFolderLocalizations.strings *) set locs to "/System/Library/CoreServices/SystemFolderLocalizations" localized string "Library" from table "SystemFolderLocalizations" in bundle (locs as POSIX file) (* => "Bibliothèque" if current locale is Français => "Library" if current locale is English * Note that current locale is the locale set when the current application is initialized, e.g., when the Script Editor is launched. *)




Regards,

H

Languages and file paths

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.