Can anyone identify what language this code is? - dotcms

I'm trying to identify what language this code is (being used in DotCMS) so i can learn to code it. Any help identifying this would be massively appreciated. Code has been desensitized.
#panelStart('XXX.XXX' )
<div class="col-md-6">
#readOnlyField('XXX', 'XXX.XXX', $XXX.XXX, {'XXX':X, 'notCurrency':true})
#readOnlyField('XXX', 'XXX.XXX', $XXX.XXX, {'XXX':X, 'notCurrency':true})
#readOnlyField('XXX', 'XXX.XXX', $XXX.XXX, {'XXX':X, 'notCurrency':true})
#readOnlyField('XXX', 'XXX.XXX', $XXX.XXX, {'XXX':X, 'notCurrency':true})
</div>
#panelEnd
Thanks

As it says in the oficial dotCMS documentation, they use HTML, CSS and Javascript as a programming language.

The "#" signs are used by Apache Velocity, which is the main server-side scripting language dotCMS support.
In Velocity, "#" signs identify Velocity commands, macros, or directives.
But those aren't built-in Velocity commands, and they're unlikely to be directives (which require Java code to implement), so they're probably macros. You'll need to look in other files to see where those macros are defined.

Related

how to disable Google Translate API from not translating proper names with common words

I am using Google Cloud Platform to create content in Indian regional language. Some of the content contains buildings and society name which have common words like 'The Nest Glory'. After conversion from Google Translate API the building name should only be spelled in the regional language, instead it is literally being translated. It sounds funny and user will never find that building.
Cloud Translation API can be told not to translate some part of the text, use the following HTML tags:
<span translate="no"> </span>
<span class="notranslate"> </span>
This functionality requires the source text to be submitted in HTML.
Access to the Cloud Translation API
How to Disable Google Translate from Translating Specific Words
After some search I think one older way is to use the transliteration API which was deprecated by google
Google Transliteration API Deprecated
translate="no"
class="notranslate"
in last API versions this features doesn't work
That's a very complex thing to do: it needs semantic analysis as well as translation and there is no real way to simply add that to your application. The best we can suggest is that you identify the names, remove them from the strings (or replace them with non-translated markers as the may not be in anything like the same position in translated messages) and re-instate them afterwards.
But ... that may well change the quality of the translation; as I said, Google Translate is pretty clever ... but it isn't at Human Interpreter yet.
If that doesn't work, you need to use a real-world human translator who is very familiar with the source and target languages.

detect language of text using c++ or shared object

i'm new to c++ and need a way for detecting the language of the text.
i searched for any plugin to do that and only found the chromum open source code.
https://code.google.com/p/cld2/
there is many pages talking about using it at python, java or stand alone but i cant find any tutorial about using it in a c++ code.
so i need a declaration for how to use it or any other good library for detecting the text language using c++.
the language text will be added by user and i want to detect if it is English , French or Arabic .. etc to apply nlp according to that.
Thanks,
Although its not a library, one option you have is to simply use Google translates API to detect the language. This is done using REST. The obvious downside is that you need to be connected to the internet to make the call. The docs explain how you can do this here

Match browsers set to Scandinavian languages based on "Accept-Language"

Question
I am trying to match browsers set to Scandinavian languages based on HTTP header "Accept-Language".
My regex is:
^(nb|nn|no|sv|se|da|dk).*
My question is if this is sufficient, and if anyone know about any other odd scandinavian (but "valid") language codes or obscure browser bugs causing false positives?
Used for
The regex is used for displaying a english link in the top of the Norwegian web pages (which is the primary language and the root of the domain and sub-domains) that takes you to the English web pages (secondary language and folder under root) when the browser language is not Scandinavian. The link can be closed / "opted-out" with hash stored in JavaScript localStorage if the user don't want to see the link again. We decided not to use IP geo-location because of limited time to implement.
Depending on the language you are working in there may be code in place you can use to parse this easily, e.g. this post: Parse Accept-Language header in Java <-- Also provides a good code example
Further - are you sure you want to limit your regex to the start of the string, as several lanaguages can be provided (the first is intended to be "I prefer x but also accept the following") : http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
Otherwise your regex should work fine based on the what you were asking and here is a list of all browser language codes: http://www.metamodpro.com/browser-language-codes
I would also - in your shoes, make the "switch to X language" link easy to find for all users until they had opted not to see it again. I would expect many people may have a preference set by default in their browser but find a site actually using it to be unexpected i.e. a user experience like:
I prefer english but don't know enough to change this setting and have never had a reason to before as so few sites make use of it.
That regular expression is enough if you are testing each item in accept-language individually.
If not individually, there are 2 problems:
One of the expected languages could not appear at the beginning of the header, but after.
Some of the expected languages abbreviations could appear as qualifier of a completely different language.

is it important to use SSI in my website?

I want to know how important SSI "Server Side Includes" for websites?
I still didn't find any importance using it. I know only that it uses file format .shtml instead of .html
any comments are appreciated.
Thanks
It's only important if you want to take advantage of the features it provides like file inclusion. It's not important at all for its own sake. In other words, if you don't need any of its capabilities, there's no reason to use it.

Parse Website Data in C++

So I am trying to develop a program that will parse a website for data, send that data into variable that I can then use for functions inside the program.
Specifically I'm trying to parse this page (Click the debuffs tab)
http://worldoflogs.com/reports/rt-1smdoscr7neq0k6b/spell/94075/
The source is pretty simple and looks like this.
<td><a href='/reports/rt-1smdoscr7neq0k6b/details/62/' class='actor'><span class='Warrior'>Zonnza</span></a></td>
<td>100</td>
</tr>
<tr>
<td><a href='/reports/rt-1smdoscr7neq0k6b/details/3/' class='actor'><span class='DeathKnight'>Fillzholez</span></a></td>
<td>89</td>
</tr>
While I only want the numbers and name, ex what is between <td></td> and between the <span class=''></span> tags. Is there anyway to do what I'm looking for?
Any help would be greatly appreciated.
I'd look into Tag Soup. It's a parser for HTML that can cope with all the horrible HTML that's out there. There's a C++ port of it available too (haven't used that so can't comment on how stable it is).
There are no C++ libraries for what you're trying to do (unless you're going to link with a half of Mozilla or WebKit), but you can consider using Java with HTMLUnit.
And for those suggesting regular expressions, an obligatory reference.
There's no need to use C++, when C-style sscanf will do, or even perl or any language with regular expression support.