You need to Register for free and Login to post a message in the forum.

Forum

Localized ressources
Last Post 2010-04-20 12:04 PM by jumatthey. 12 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-01-29 02:23 PM  
Hello,

I would like to add localized ressources on a page like this :

<%$ Resources:MyRessource, String1 %>

I have put the Myssource.lng-LNG.resx file in the App_GlobalRessources folder.

But this doesn't work. I have an error on the page I want to display. How can I add customized labels on a page using the <%$ Resources:MyRessource, String1 %> tag ??

Thank you for information

JM
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-01 04:46 PM  
up
Joseph CraigUser is Online
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:8996
Avatar

--
2010-02-02 12:56 AM  
Use the TEXT skin object.

You will find additional documentation here.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-02 08:15 AM  
Thank you.

Could you please provide me with an example ? This would be very useful for me.

Thank you very much
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-02 09:05 AM  
I have set up a test TEXT tag so :

<dnn:text runat="server" id="mytext1" text="String1" resourcekey="test" replacetokens="true"> < dnn:TEXT runat="server" ID="mytext1" Text="String1" ResourceKey="test" ReplaceTokens="true" / >

Now I have put a test.resx in the App_GlobalResources folder but it seems my text isn't translated. What am I doing wrong ? I have also put this line in my ressource file : name:String 1 value:Ceci est un test

It seems there is no link with my ressource file. Where should I put it insted of App_GlobalResources ?

Thank you for information.
Joseph CraigUser is Online
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:8996
Avatar

--
2010-02-02 02:59 PM  
DotNetNuke does not automatically translate text.  You need to have "language packs" installed for each language.  The language pack include resource files for a specific language.  So, you will need to add test.resx files for each of the languages that you support.

You will need to follow the structure and naming conventions for each of the languages.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-02 03:28 PM  
I would like just one label to be localized. How do I do this ? Which token do I use ? Can you provide me with a code sample please ?
Joseph CraigUser is Online
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:8996
Avatar

--
2010-02-02 03:41 PM  
I am hardly expert in localization issues.  But, it appears that the German DNN group is one place to go for help (www.dnn-usergroup.de).

What you will need to do, based on a quick look, is provide a resource file for each language.  Inside of the resource file, you will translate your text.  If you've installed the correct language packs and also the localization skin object so that you can switch languages, DotNetNuke will pull the localized string from the appropriate resource file.  You'll need to name the resource files appropriately, too.  Once you have installed a language pack, you can see how that is done.

To me, it looks like you duplicate the resource files, and append language indicators to the file names. That's at least a place to begin.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-02 03:58 PM  
Thank you for you reply.

This is exactly what I have done already. I have built a custom module called gridview.ascx in the Desktop Modules directory. From there I have a App_LocalResources folder in my module folder and then three ressource files named after each language that is : gridview.ascx.resx, gridview.ascx.fr-FR.resx, gridview.ascx.de-DE.resx.

Then I have a test1 line in each of my resource file.

Then on my ascx page I try to call from these files with this tag :

< dnn:TEXT runat="server" ID="mytext1" ResourceKey="test1" Visible="true" / >

I have put "test1" in the ResourceKey label so I think it should call this line from the ressource files, depending on current selected local. And yes I have installed all the necessary language and I can switch from one another through flags on top of the page. All my pages are actually successfully localized, except for this custom module I have build.

It seems I dont know how to use the appropriate tag to call from the ressource files, tho I have put them in the App_LocalResources folder in my module folder. This is how it is done with the other built-in modules.

Seems I am doing something wrong here, which is I can't call from the ressource file.

Thank you for support

JM
Joseph CraigUser is Online
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:8996
Avatar

--
2010-02-03 03:21 PM  
If you look at the Minimal Extropy skin, you will find this:

         < dnn:TEXT runat="server" id="dnnTEXT" CssClass="breadcrumb_text" Text="You are here >" ResourceKey="Breadcrumb" / >

The TEXT skin object is documented here.  It has several attributes.  They include:


  • Text  -- The text to display if there is no text available from a resource file. This is also the name of the key in the resource file that will be used
  • resourceKey -- The name of the resource file (*.resx) to use.

In your example, the resource file would be test1.*.resx.  You didn't include Text as an attribute, so the skin object doesn't know which key to use.


-------
As I said, I'm not an expert here, but this is where I would look.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-02-16 09:57 AM  
Still looking for a way to localize my labels. This way -> <%$ Resources:MyRessourceFile, Key %>

That is without breaking up DNN and generating errors.

If anyone has any experience with this, thanks for letting me know.

Regards

JM
hassangas2003User is Offline
Nuke Newbie
Nuke Newbie
Posts:3

--
2010-04-20 06:23 AM  
Hi JM
May by the posts for Joseph Craig it more more more clear,and this man he have more experience in this field.
plz try this:
in html file:
<asp:Label ID="Test1" runat=server Text="Test" Resources=Test1>" >
in local recources:

this is test1:


Thanks
jumattheyUser is Offline
Nuke Ace
Nuke Ace
Posts:42

--
2010-04-20 12:04 PM  
I found a way thru C# code. You can localize your content directly under C#

protected string GetLocalResource(string key)
{
return DotNetNuke.Services.Localization.Localization.GetString(key, this.LocalResourceFile).ToString();
}
yourstuff.Text = GetLocalResource("key");

This way you have to name your ressource file after the ascx file for example yourfile.ascx.lng-LNG.resx in the current App_LocalResources folder.
You are not authorized to post a reply.

Active Forums 4.3

Latest Forum Posts

Problem After Attaching/Detaching Database.mdf by Prakasam Srinivasan
I successfully installed DNN 6 on my local machine using IIS 7.5. Its working good. When I attach to
RE: Module Security permissions by Bhushan Gholap
Thanks for the reply!!! I would definitely contact sales engineer team of DNN.
RE: There's a tutorial for this somewhere by Eric W
The error I got was the Connection Error(s): Index #: 0 Source: .Net SqlClient Data Provider
RE: DNN 6 Modules Not Showing by Joseph Craig
Where can I see this? If you'd like to send me some login credentials so that I can look, use the c
RE: DNN 6 Modules Not Showing by Mike DeBaise
No, modules are set to all viewers/users. Just cant figure this out, it really doesnt make any sense
RE: Searching in DNN by Alex Ritter
Will do Joseph. I'll let you know my findings.
RE: DNN Blog module syndication by Aggiedan97
The reason I bring it up - Lee had originally provided a tutorial regarding podcast submission to iT
RE: installing DNN locally - problems with relative path by Joseph Craig
Recently I discovered this very useful blog post: http://www.dotnetnuke.com/Resources/Blogs/EntryId
installing DNN locally - problems with relative path by Prakasam Srinivasan
Instead of making tests on my live site, I recently seen various tutorials concerning installing DNN
RE: Moved site to subdomain, now no links work by Joseph Craig
PortalAlias is a table in the DotNetNuke database. Normally you would adjust this on the Site Set
RE: DNN 6 Modules Not Showing by Joseph Craig
Did you also check the module permissions? Are the modules permissions such that only logged in use
RE: Add to the menu with a custom module by Joseph Craig
I can't tell you how to do this, but ... I'd think you could start with a version of the Mega menu i
RE: Where is the Manage Profile default Properties required error message found? by Joseph Craig
You'll find it in one of those resource files you can get at with the Language Editor. I'm not sure
RE: Facebook Like Button by Joseph Craig
You can get the code you need from Facebook and then you can paste it into an HTML module in HTML mo
RE: Module Security permissions by Joseph Craig
Just a thought -- as you are evaluating the Professional version of DotNetNuke, you might want to as
RE: Module Security permissions by Joseph Craig
The module permissions that you mention are for the module: Edit the module's settings, Delete the
RE: Module permission does not work! by Joseph Craig
When you login are you a member of the Administrators security role? I don't believe that you can d
DNN 6 Modules Not Showing by Mike DeBaise
Hello all. I created a skin for DNN 6 and noticed that only while I am logged in can I see the modul
RE: URL login bypass by Joseph Craig
If you want the private page to be protected, you are going to have to have some way of "logging in.
RE: DNN Blog module syndication by Joseph Craig
Sorry. I'm not really familiar with feedburner and I haven't had a chance to research this. While
You are not logged in.
You must log in to access all 
650+ videos, tutorials, podcasts, and more.
RSS Feeds