Convert URL language as website language changes - url

How can we convert language of URL as website language changes?
Like take example of www.example.com/test it is in English. When I am changing website language to Persian it should be www.example.com/آزمون.
Is it possible? How can we achieve this?

If you are using PHP, this may help. You can change the language as you wish, depending on what language you want your website to be in.
/*
-----------------
Language: German
-----------------
*/
$lang = array();
$lang['PAGE_TITLE'] = 'Meine Webseite Titel';
$lang['HEADER_TITLE'] = 'Meine Website-Header Titel';
$lang['SITE_NAME'] = 'Meine Website';
$lang['SLOGAN'] = 'Mein Slogan hier';
$lang['HEADING'] = 'Position';
// Menu
$lang['MENU_HOME'] = 'Heim';
$lang['MENU_ABOUT_US'] = 'Über uns';
$lang['MENU_OUR_PRODUCTS'] = 'Unsere Produkte';
$lang['MENU_CONTACT_US'] = 'Kontaktieren Sie uns';
$lang['MENU_ADVERTISE'] = 'Werben';
$lang['MENU_SITE_MAP'] = 'Site Karte';
Also check out this thread.

Related

How to change the language of Xtrareport

I'm using XtraReport and its wonderful, but I'm having a little problem.
I want change the language of report before printing, because I want use Indian Numbers in my report instead of En-Numbers.
I try to change the current language of the thread but nothing happens:
CultureInfo arabicCI = new CultureInfo("ar-SA");
Thread.CurrentThread.CurrentCulture = arabicCI;
Thread.CurrentThread.CurrentUICulture = arabicCI;
arabicCI.NumberFormat.DigitSubstitution = DigitShapes.NativeNational;
Thread.CurrentThread.CurrentCulture.NumberFormat.DigitSubstitution =
DigitShapes.NativeNational;
I also tried:
System.Threading.Thread.CurrentThread.CurrentUICulture =
new System.Globalization.CultureInfo("SA");
System.Threading.Thread.CurrentThread.CurrentCulture =
new System.Globalization.CultureInfo("ar-SA");
but it didn't work.

TYPO3 - Unique content elements in translations not displaying

I'm setting up a Typo3 site, with a default language of English, and a German translation (id=1).
However, on the German translation, I need to be able to create additional content elements in the 'default' column that do not exist in the default.
However, whenever I try to create new content elements, they are showing up in BE, but on the frontend it only renders ones that were created with the 'Copy Default' button.
This is my config:
config.linkVars = L
config.uniqueLinkVars = 1
config.sys_language_overlay = default
config.sys_language_mode = content_overlay
config.language = en
config.locale_all = en_EN
config.htmlTag_langKey = en-EN
config.sys_language_uid = 0
[browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v=”urn:schemas-microsoft-com:vml” xml:lang="en"
[globalVar = GP:L = 1]
config.language = de
config.locale_all = de_DE
config.htmlTag_langKey = de-DE
config.sys_language_uid = 1
[globalVar = GP:L = 1] && [browser = msie]
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:v=”urn:schemas-microsoft-com:vml” xml:lang="de"
[global]
I've copied over the 2 default elements, then tried to add additional elements that are not rendering.
I've not worked with TYPO3 before, but I'm pretty sure those additional content elements should be rendered? Do I need to include any additional markup in the templates to enable it?
Try this:
config.sys_language_overlay = hideNonTranslated
config.sys_language_mode = strict
[globalVar = GP:L = 1]
config.sys_language_overlay = 0
[end]
By setting config.sys_language_overlay = 0, TYPO3 should display your german records even if there is no record in the default language.
Also i corrected your default values for config.sys_language_overlay and config.sys_language_mode since they are not valid.
The documentation can be found at TSREF.
Answering my own question for future visitors...
When you set config.sys_language_overlay it tells Typo3 to actually get all the records from the default language, and then just overlay the matches over the top - that way, it will only show translated elements that have been descended from the default language.
Taking that out completly, it then allows you to use as many content elements in a translation as you want, without paying attention to the default language.
As #Shufla mentioned, using config.sys_language_mode = strict then means that any translations that have less elements than the default won't then inherit the default language ones.

RightFax 10.0 Integration With C#

If I insert the values into the corresponding tables of RightFax, does it FAX automatically or do i need to write the following code for that?
RFCOMAPILib.FaxServerClass faxserver = new RFCOMAPILib.FaxServerClass();
faxserver.ServerName = "ServerName";
faxserver.Protocol = RFCOMAPILib.CommunicationProtocolType.cpNamedPipes;
faxserver.UseNTAuthentication = RFCOMAPILib.BoolType.True;
faxserver.OpenServer();
RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax) faxserver.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);
// set up your 'fax' object the way you want it, below is just some sample options
fax.ToName = "John Doe";
fax.ToFaxNumber = "4255551111";
fax.ToVoiceNumber = "4255550000";
fax.ToCompany = "ACME";
fax.FromName = "My Company";
fax.FromVoiceNumber = "4255552222";
fax.Send();
Can you please provide me sample code for attachments? If RightFax sends the FAX automatically then which tables do I need to fill-in in order to do that?
Thanks
the below code is vb.net but will show you how to send a fax and add attachment as well, hope this helps. I've written a post about this here but here's the code below ....
Dim FaxAPI As RFCOMAPILib.FaxServer
Dim fFax As RFCOMAPILib.Fax
FaxAPI = New RFCOMAPILib.FaxServer
FaxAPI.ServerName =something
FaxAPI.Protocol = RFCOMAPILib.CommunicationProtocolType.cpTCPIP
FaxAPI.UseNTAuthentication = RFCOMAPILib.BoolType.False
FaxAPI.AuthorizationUserID = something
FaxAPI.AuthorizationUserPassword = something
FaxAPI.OpenServer()
fFax = FaxAPI.CreateObject(RFCOMAPILib.CreateObjectType.coFax)
fFax.Attachments.Add(“D:\FilePickupIn\2222222222-20110322142718-01.tif”)
fFax.HasCoversheet = RFCOMAPILib.BoolType.False
fFax.ToFaxNumber = something
fFax.ToName = something
fFax.Send()
FaxAPI.CloseServer()
FaxAPI = Nothing
fFax = Nothing
happy to help if you get stuck with anything...

How to replace many symbols with a single word in Lua?

I must replace all of these characters, "①②③④⑤⑥⑦⑧⑨⑩", with "\item".
I have used this code:
stra = string.gsub(text, "①", "\\item")
strb = string.gsub(stra, "②", "\\item")
strc = string.gsub(strb, "③", "\\item")
strd = string.gsub(strc, "④", "\\item")
stre = string.gsub(strd, "⑤", "\\item")
However, this is very verbose. Is there a simpler way to replace all of those items?
local symbols_trans = {
["\226\145\160"]--[[①]] = "\\item1",
["\226\145\161"]--[[②]] = "\\bananas",
["\226\145\162"]--[[③]] = "\\cactus",
["\226\145\163"]--[[④]] = "\\etc",
["\226\145\164"]--[[⑤]] = "\\item5",
["\226\145\165"]--[[⑥]] = "\\item6",
["\226\145\166"]--[[⑦]] = "\\item7",
["\226\145\167"]--[[⑧]] = "\\item8",
["\226\145\168"]--[[⑨]] = "\\item9",
["\226\145\169"]--[[⑩]] = "\\item10",
}
text = string.gsub(text, "(\266\145.)", symbol_trans)
Or if you want to replace them all with"\\item":
text = string.gsub(text,
"\266\145[\160-\169]",
"\\item"
)
[\160-\169] is equivalent to [\160\161\162\163\164\165\166\167\168\169].
See the Lua manual for information on ranges and, in general, Lua patterns.
You could also be fancy:
text = string.gsub(text,
"\266\145([\160-169])",
function(c)
return "\\item"..(string.byte(c)-160+1)
end
)
This will turn ① into \item1, ② into \item2, and so on.
Use a "set" as described in the tutorial: http://lua-users.org/wiki/PatternsTutorial
string.gsub(text, "[①②③④⑤⑥⑦⑧⑨⑩]", "\\item")
Is there a simpler way to replace all of those items?
Not without a Lua pattern matching library that knows what UTF-8 is. Lua is not Unicode aware; it has no idea how to search for Unicode symbols.
If you're using some non-multibyte encoding, then what John suggested might work. But not if it's UTF-8.
For your specific case, you could always do this:
local symbolsToChange { "①", "②", ...}
for i, sym in ipairs(symbolsToChange) do
string.gsub(text, sym, "\\item")
end

How can I protect an excel sheet, except for a particular cell using Open XML 2.0?

I am generating a report using OpenXML and exporting it to excel. I want to protect the excel sheet except for a particular cell.
If anyone has worked on this before, kindly help
Thanks,
Amolik
PageMargins pageM = worksheetPart.Worksheet.GetFirstChild<PageMargins>();
SheetProtection sheetProtection = new SheetProtection();
sheetProtection.Password = "CC";
sheetProtection.Sheet = true;
sheetProtection.Objects = true;
sheetProtection.Scenarios = true;
ProtectedRanges pRanges = new ProtectedRanges();
ProtectedRange pRange = new ProtectedRange();
ListValue<StringValue> lValue = new ListValue<StringValue>();
lValue.InnerText = "A1:E1"; //set cell which you want to make it editable
pRange.SequenceOfReferences = lValue;
pRange.Name = "not allow editing";
pRanges.Append(pRange);
worksheetPart.Worksheet.InsertBefore(sheetProtection, pageM);
worksheetPart.Worksheet.InsertBefore(pRanges, pageM);
ref : http://social.msdn.microsoft.com/Forums/en-US/a6f7502d-3867-4d5b-83a9-b4e0e211068f/how-to-lock-specific-columns-in-xml-workbook-while-exporting-dataset-to-excel?forum=oxmlsdk
Have you tried using the OpenXML Productivity Toolkit?
from what I can see you have to add a
new CellFormat
with attribute
ApplyProtection = true
to
CellFormats
append
new Protection
with attribute
Locked = false
to the the CellFormat you created.
CellFormat is a element of CellFormats which is a element of Stylesheet
then to the Worksheet you add a
new SheetProtection(){ Password = "CC1A", Sheet = true, Objects = true, Scenarios = true };
I havent tried this, but it should be easy enought to find out what you need to do with the Productivity Toolkit. I hope this points you and anyone trying to do this in the right direction.

Resources