Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-10-18 15:52:00

ggstone
Member
Registered: 2011-10-12
Posts: 12

[Solved] Is there any different between ‘Name’ and '_Name' ?

hi,
the file xfdesktop-4.6.1\modules\menu\directory-data\xfce-network.directory.in like this

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Directory
Icon=applications-internet

_Name=Network
_Comment=Network applications and utilities

I find that some files use ‘Name’,some files use '_Name',is there any different between them?

now, I have a file like this is ok! I can set different language.

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Icon=applications-internet
Name=reboot

Name[zh_CN]=重启
Name[zh_TW]=重啟
Comment=******

but the other file like this is wrong! I can't set different language.

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Directory
Icon=applications-internet
_Name=shutdown

Name[zh_CN]=关机
Name[zh_TW]=關機
_Comment=******

Is there any different between them?
Thanks a lot!

Offline

#2 2011-10-18 16:07:26

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,144
Website

Re: [Solved] Is there any different between ‘Name’ and '_Name' ?

_Name marks the string are translatable (for intltool-update), so the *.desktop.in file will become *.desktop with translated strings (when running make).

Offline

#3 2011-10-19 00:54:43

ggstone
Member
Registered: 2011-10-12
Posts: 12

Re: [Solved] Is there any different between ‘Name’ and '_Name' ?

Nick,thanks.
I know that the _Name variable can be translated to surpport different language automatic。
now,I want to add a new menu,so I write the xfce-shutdown.directory.in file like this:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Directory
Icon=xfce-system-exit

_Name=Shutdown
_Comment=Shut down system

after make command,  the new file xfce-shutdown.directory is as same as xfce-shutdown.directory.in, it's not  translated automatic.
why?Dose xfce just surpport a liitle and certain _Name variable can be translated?

Last edited by ggstone (2011-10-19 07:36:13)

Offline

#4 2011-10-19 16:42:30

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,144
Website

Re: [Solved] Is there any different between ‘Name’ and '_Name' ?

If the string is know known (not in the po files) not translation is made. The file also needs to be known in the desktop.in files in Makefile.am so it is processed by INTLTOOL_DESKTOP_RULE.

Offline

#5 2011-10-21 03:53:47

ggstone
Member
Registered: 2011-10-12
Posts: 12

Re: [Solved] Is there any different between ‘Name’ and '_Name' ?

Thanks Nick!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 533.73 KiB (Peak: 534.57 KiB) ]