Share Localization - alfresco

I was able to localize my Alfresco Model (plus constraints lists) by following these rules :
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Model_Localization
But I would like to know if there is something similar for Share?
Do we only have to use the "label-id" attributes without worrying of any convention?
Is it better to use :
label.companyName=Company name
or something like
sop_sopModel.field.sop_companyName.title=Company Name
or anything else ?
I didn't see any recommandation on the wiki.
Here is an example of label-ids I don't know how to format.
This is a part of my share-config-custom.xml file.
I know this is not really important but I would like to do things properly.
<config evaluator="aspect" condition="sop:company">
<forms>
<form>
<field-visibility>
<show id="sop:companyName" />
<show id="sop:companyAddress" />
</field-visibility>
<appearance>
<set id="sopPanel" appearance="bordered-panel" label-id="???" />
<field id="sop:companyName" label-id="???" set="sopPanel" />
<field id="sop:companyAddress" label-id="???" set="sopPanel" />
</appearance>
</form>
</forms>
</config>

You don't normally need to use the label-id attribute. If your model definition has a message bundle associated with it then the correct labels for your current locale will come through from the repository automatically.

Related

How do you enable document function in XSLT (called from ASP.NET)?

I have a stylesheet using a for each loop over the XML doc but when it comes accross using the document() method it fails.
<td >
<xsl:value-of select="document('Departments.xml')/Departments/Department[#Id=dep]/Name"/>
</td>
The variable has a value each loop which prints out
Execution of the "document()" function was prohibited. Use the
"XsltSettings.EnableDocumentFunction" property to enable it.
I think if XslCompiledTransform is used by the asp:xml control instead of XslTransform it means that the environment you are working in has set aspnet:RestrictXmlControls to true (https://learn.microsoft.com/en-us/previous-versions/aspnet/hh975440(v=vs.120))
<appSettings>
<add key="aspnet:RestrictXmlControls" value="true" />
</appSettings>
so you might need to try/check whether your locale web.config can set it back to
<appSettings>
<add key="aspnet:RestrictXmlControls" value="false" />
</appSettings>
to have XslTransform being used where you are not restricted by default XsltSettings.

Action form forward path not a url

What does it mean when I have a path like the example below in the first forward (then success forward)
<action
type="com.testpackage.servlettest"
path="/ClassHomepage"
scope="request">
<forward
name="success"
path=".class.homepage"
redirect="true" />
<forward
name="failure"
path="/Homepage.do"
module="/"
redirect="false" />
</action>
I understand the failure forward will forward to the page "/Homepage.do" if "failure" is returned
return mapping.findForward("failure");
But what happens if I return
return mapping.findForward("success");
What package will this try to load? How do I find out by looking at web.xml and struct-config.xml files?
You are using tiles, and you need to look in your tiles definition file (usually something like WEB-INF/tiles-defs.xml). Search for a <definition name=".class.homepage"> ... </definition> to find out which view it will direct to.

Plone: extracting i18n strings from dexterity xml models

I'm working with dexterity xml models and am looking for a way to extract i18n strings from my models. It doesn't look like i18ndude or infrae.i18nextract do this. As a result all the translations strings in my xml models don't show in the generated .pot files.
Some of the models have more than 30 fields, so manual extraction is becoming tedious.
i18ndude do extract i18n messages from model files without any issues; check you're including your domain and marking the strings to be extracted.
see our i18n script and check compare, as an example, collective.cover's model with yours:
<?xml version="1.0" ?>
<model xmlns="http://namespaces.plone.org/supermodel/schema"
xmlns:form="http://namespaces.plone.org/supermodel/form"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="collective.cover">
<schema>
<field name="template_layout" type="zope.schema.Choice" form:widget="collective.cover.widgets.selectpreview.SelectFieldWidget"
form:omitted="z3c.form.interfaces.IEditForm:true">
<description i18n:translate=""
>Choose one of the predefined layouts</description>
<title i18n:translate="">Layout</title>
<vocabulary>collective.cover.AvailableLayouts</vocabulary>
<default>Empty layout</default>
</field>
<field name="cover_layout" type="zope.schema.Text"
form:omitted="z3c.form.interfaces.IForm:true
z3c.form.interfaces.IAddForm:true
z3c.form.interfaces.IEditForm:true">
<description i18n:translate=""
>The layout to be used to render groups and tiles</description>
<title i18n:translate="">Cover Layout</title>
</field>
</schema>
</model>

How can i remove the missing subpackage error in a phpcs ruleset?

I want to remove this because i dont need it on my project.
<rule ref="Squiz.Commenting.FileComment">
<properties>
<property name="subpackage" value="false"/>
</properties>
</rule>
See you
The way to exclude that specific error message in your ruleset.xml file is to use:
<exclude name="Squiz.Commenting.FileComment.MissingSubpackageTag" />
Use the -s command line argument to determine the code for a specific error message. You'll see something like this:
Missing #subpackage tag in file comment
(Squiz.Commenting.FileComment.MissingSubpackageTag)
If you want to exclude the whole sniff, you'd instead use:
<exclude name="Squiz.Commenting.FileComment" />
There are a lot of other things you can do in a ruleset file. See the docs for more examples: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml

What are appSettings keys valid characters?

This is strange. I thought I would easily find this information googling, but I haven't had much success. All I want to know is what are the valid characters that can be used for the keys in the AppSettings section of a Web.config file. Eg:
<add key="MySpeed" value="100" />
<add key="My.Speed" value="100" />
<add key="My Speed" value="100" />
<add key="Vélocité" value="100" />
Would all of the above keys be permitted?
The Microsoft documentation states only that the key is a String attribute. Nothing more. Their examples do show a key with spaces in the name.

Resources