[Gambas-user] Probem analysing Desktop path

Matti math.eber at ...221...
Tue Mar 6 20:34:43 CET 2012


Willy,

The easiest solution to store some infos would be to use gb.settings.
Then you don't have to care about directories at all, gambas does it for you, 
and you can read/write the infos very easily.
See http://gambasdoc.org/help/comp/gb.settings
But I don't know what you store in your SystemInfo.txt, maybe this is not 
practicable.

If so, why do you want to use "~/Desktop" by all means? Why not make a directory 
"~/.YourApp" and store the SystemInfo.txt there? So it would be the same on 
every system?


Am 06.03.2012 17:37, schrieb Willy Raets:
> Rolf,
>
> On my system I installed English OS with Dutch language.
> No problem "~/Desktop" is there.
>
> On a system of a friend of mine he installed Dutch OS with Dutch
> language. And that seems to be the difference.
> The is NO "~/Desktop", instead ls at command returns
> "~/Bureaublad" (Dutch for desktop)
>
> When changing code to:
> If Exist(User.Home&  "/Desktop") Then
>    sPath = User.Home&   "/Desktop/SystemInfo.txt"
> Else
>    If Exist( User.Home&  "/Bureaublad") Then
>       sPath = User.Home&   "/Bureaublad/SystemInfo.txt"
>    Endif
> Endif
>
> It works fine on his sytem and on mine.
>
> I was thinking about using the internationalisation and do something
> like:
>
> Dim sDesktop, sPath As String
> sDesktop = ("Desktop")
> If Exist (User.Home&  "/"&  sDesktop) Then
>    sPath = User.Home&  "/"&  sDesktop&  "/SystemInfo.txt"
> Endif
>
> But this will NOT work on my system as OS has "/Desktop" folder and
> because of language Dutch installed, Gambas application would look for
> "Bureaublad" in my case, which I don't have on my system.
> So this would not work for all situations and makes it even worst.
>
> I also run into the .desktop file doing research on the matter, but it
> seems to be a KDE thing. I'm on Gnome and no .desktop file found there.
>
> Thanks for thinking along. At least I can now implement 3 languages for
> Desktop :-) not that it solves the problem.
>
>
> On di, 2012-03-06 at 17:09 +0100, Rolf-Werner Eilert wrote:
>> Willy - are you really sure the path name is translated, not only its
>> caption within the GUI? I think you don't need to worry... On my German
>> system, it would be "Arbeitsfläche", and there is still a ~/Desktop
>> (with k).
>>
>> Rolf
>>
>>
>>
>> Am 06.03.2012 15:48, schrieb Willy Raets:
>>> Hi all,
>>>
>>> I'm have this in my code:
>>>
>>> If Exist(Use.Home&   "/Desktop) then
>>>      sPath = User.Home&   "/Desktop/SystemInfo.txt"
>>> Endif
>>>
>>> Now it turns out that this only works on systems with English language.
>>> Other systems translate "Desktop" into local language!!
>>> Like for Dutch it will be "Bureaublad" instead of "Desktop"
>>>
>>> As it is impossible for me to test for 150 different ways "Desktop" is
>>> written in other languages, I was wondering is there a way around this.
>>>
>>> Does the system somewhere have the original English name for Desktop
>>> that I can test against? Or is there any other way of solving this
>>> problem?
>>>
>>> Thanks,
>>>
>>> Willy
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Keep Your Developer Skills Current with LearnDevNow!
>>> The most comprehensive online learning library for Microsoft developers
>>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>>> Metro Style Apps, more. Free future releases when you subscribe now!
>>> http://p.sf.net/sfu/learndevnow-d2d
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Keep Your Developer Skills Current with LearnDevNow!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-d2d
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list