[req,web] Make it possible to handle page language from URL prefix
Adding a short language prefix to URL (like "/en" or "/fr") changes the
language the pages are displayed in. This prefix is kept during navigation.
This way it is not necessary to do language negotiation, nor to use user
preferences to determine which language to apply.
This behavior is controlled through a new configuration option
"language-mode", which replaces "language-negociation" option and which values
may be "http-negotiation", "url-prefix" or "" (to disable language setting and
force using "ui.language" property). Migration from previous option is not
handled because I could not manage to have it working (users will get prompted
with the configuration file diff anyways).
Add some tests checking various scenarios.
Closes #15743487
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1036.6421"
height="845.07812"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
sodipodi:docname="primaryview_template.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.0"
inkscape:export-filename="/home/steph/local/fcubicweb/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="43.451603"
inkscape:export-ydpi="43.451603">
<defs
id="defs4">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.9357135"
inkscape:cx="518.32104"
inkscape:cy="337.0428"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1307"
inkscape:window-height="1168"
inkscape:window-x="0"
inkscape:window-y="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(162.2968,90.697922)">
<g
id="g3869"
transform="matrix(1,0,0,1.0373644,0,-72.039777)"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449">
<rect
y="-15.840891"
x="-159.08963"
height="770.11017"
width="1033.0049"
id="rect3301"
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1.90144825;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<text
id="text3865"
y="19.784882"
x="-150.07172"
style="font-size:28.67479324px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
id="tspan3867"
y="19.784882"
x="-150.07172"
sodipodi:role="line">contentmain</tspan></text>
</g>
<rect
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1.45654476;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2383"
width="772.32111"
height="43.888428"
x="-131.1837"
y="86.559296"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:16px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.50000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans;font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"
x="-122.69418"
y="115.50363"
id="text2385"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="-122.69418"
y="115.50363"
id="tspan3163">navcontenttop</tspan></text>
<rect
style="fill:#ffd5d5;fill-rule:evenodd;stroke:#000000;stroke-width:3.06523442;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3167"
width="770.26868"
height="203.16078"
x="-125.88269"
y="172.90417"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="348.26724"
y="205.34305"
id="text3169"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="348.26724"
y="205.34305"
id="tspan3171">render_entity_attributes()</tspan></text>
<rect
style="fill:#ffd5d5;fill-rule:evenodd;stroke:#000000;stroke-width:3.06523442;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3173"
width="769.93549"
height="237.84663"
x="-125.03326"
y="391.32156"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="360.99954"
y="428.38055"
id="text3175"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="360.99954"
y="428.38055"
id="tspan3177">render_entity_relations()</tspan></text>
<rect
style="fill:#ffd5d5;fill-rule:evenodd;stroke:#000000;stroke-width:2.15903592;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3185"
width="178.93939"
height="612.36584"
x="667.10443"
y="84.64225"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.50000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans;font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"
x="105.32364"
y="-810.65997"
id="text3187"
transform="matrix(0,1,-1,0,0,0)"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
id="tspan2408">render_side_boxes()</tspan></text>
<rect
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:3.0652349;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3191"
width="771.97766"
height="55.647793"
x="-127.80586"
y="642.0293"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="-121.22153"
y="674.1748"
id="text3181"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="-121.22153"
y="674.1748"
id="tspan3183">navcontentbottom</tspan></text>
<rect
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1.68198514;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3881"
width="986.90503"
height="45.800392"
x="-128.34428"
y="-31.574066"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="355.60541"
y="-2.7424495"
id="text3883"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="355.60541"
y="-2.7424495"
id="tspan3885">render_entity_toolbox(), render_entity_title()</tspan></text>
<rect
style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1.68198514;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect3890"
width="986.90503"
height="45.800392"
x="-128.87863"
y="19.723684"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449" />
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="565.71027"
y="50.135612"
id="text3892"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
x="565.71027"
y="50.135612"
id="tspan3894">render_entity_summary()</tspan></text>
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="87.154541"
y="114.2578"
id="text3899"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
id="tspan3903"
x="87.154541"
y="114.2578">content_navigation_components('navcontenttop')</tspan></text>
<text
xml:space="preserve"
style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
x="88.46772"
y="675.71582"
id="text2410"
sodipodi:linespacing="125%"
inkscape:export-filename="/home/auc/src/fcw/cubicweb/doc/book/en/images/primaryview_template.png"
inkscape:export-xdpi="60.912449"
inkscape:export-ydpi="60.912449"><tspan
sodipodi:role="line"
id="tspan2412"
x="88.46772"
y="675.71582">content_navigation_components('navcontenttop')</tspan></text>
</g>
</svg>