How to override language files in Typo3 version 7.6? - typo3

I really need to know how to override languagefiles from extensions. For example, I have powermail installed and I have one language file from that extension that I need to override.
So I've got an extension called website_head and in that I created the file:
typo3conf\ext\website_head\Resources\Private\Language\Overrides\powermail\Resources\Private\Language\locallang.xlf
And the file I want to override is:
typo3conf\ext\powermail\Resources\Private\Language\locallang.xlf
When I clear the caches it does not change (but when I change the original it does change the text, it's just not overriding)
Also this is what's inside the override locallang.xlf file:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-05-02T12:00:00Z" product-name="powermail">
<header/>
<body>
<trans-unit id="validationerror_mandatory">
<source>Custom text</source>
</trans-unit>
</body>
</file>
</xliff>

Have a look at https://docs.typo3.org/typo3cms/CoreApiReference/7.6/Internationalization/Translation/Index.html:
You probably need to:
1) declare your XLF:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:powermail/Resources/Private/Language/locallang.xlf'][] = 'EXT:website_head/Resources/Private/Language/Overrides/powermail/Resources/Private/Language/custom.xlf';
2) override a label:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-09T18:44:59Z" product-name="website_head">
<header/>
<body>
<trans-unit id="validationerror_mandatory" xml:space="preserve">
<source>Custom text</source>
</trans-unit>
</body>
</file>
</xliff>

Related

Magento 2 : template file not overridden correctly

I have wrote the below code to override magento 2 frontend customer edit form.
customer_account_edit.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Test_Modul::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
But it is not working. Please help me to fix it?
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Emipro_Module::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
I have used above code and its work fine for me.
Also Your code seems right. Did you make your phtml file under proper location like: Vendor/Module_Name/view/frontend/templates/customer/form/edit.phtml
Also check that if there is no any spell mistake in your module name or path.
customer_account_edit.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Test_Module::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
you need to create a template file for this on the Path.
app/code/Test/Module/view/frontend/templates/customer/form/edit.phtml

Eclipse EE Kepler Spring MVC unable to locate views in .html/.jsp

I'm new to Spring MVC. I'm trying out simple projects like Hello World.
I originally created a Hello World using IntelliJ IDEA IDE which worked just fine. However, when I tried Eclipse EE IDE, it returned a 404 message
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>FirstSpringMVCProject</display-name>
<servlet>
<servlet-name>spring-dispatcher</servlet-name> <!-- spring-dispatcher is the file named spring-dispatcher-servlet.xml -->
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
spring-dispatcher.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="com.springmvcproject" />
<!-- HandlerMapping class -->
<!-- There are plenty of handler mapping classes, this is just an example of one of the classes available -->
<bean id="HandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<!-- defines the location or path where to look for views and what file extension to look for -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
HelloController.java
package com.springmvcproject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class HelloController {
#RequestMapping("/hello")
public String helloWorld(){
return "hellopage";
}
}
hellopage.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h4> This is the hello page (HelloPage.jsp)</h4>
</body>
</html>
I don't see any reasons why it will not display the contents of the hellopage.jsp when I try to access http://localhost:8080/FirstSpringMVCProject/hello
Here's the screenshot of the folder structure. There are no warnings or error.
I don't know if I just missed something here or if Eclipse is requiring something else.
I hope you can help.
Thank you.

Adding pubsubhubbub link tag to Atom feed

According to Google the link tag containing the URL to the pubsubhubbub hub (This is a really terrible name) needs to go under the Atom entry element like so:
<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-GB" xmlns="http://www.w3.org/2005/Atom">
<!-- ... -->
<entry>
<link rel="hub" href="https://pubsubhubbub.appspot.com/" />
<!-- ... -->
</entry>
</feed>
However, all the implementations and blog posts I have seen add it to the feed element instead like so:
<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-GB" xmlns="http://www.w3.org/2005/Atom">
<!-- ... -->
<link rel="hub" href="https://pubsubhubbub.appspot.com/" />
<entry>
<!-- ... -->
</entry>
</feed>
What is the correct location for it?
It should be at the feed level: http://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.3.html#discovery (that is btw. the same spec, Google is referencing).

Typo3 Fluidtemplate multilanguage how to?

I use this Typoscript code:
lib.search = FLUIDTEMPLATE
lib.search.file = {$partialsTemplatesPath}search.html
Whats the best way to use multilanguage inside this Fluidtemplate?
Using lib.search.variables and GP:L conditions cant be the best way, right?
UPDATE:
Template:
<f:translate key="LLL:{locallangPath}locallang.xlf:search" />
XLF File:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-10-21T12:50:51Z" product-name="content">
<header/>
<body>
<trans-unit id="search">
<source>Search</source>
</trans-unit>
</body>
</file>
</xliff>
Translated XLF (de.locallang.xlf):
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="de" datatype="plaintext" original="messages" date="2013-10-21T12:50:51Z" product-name="content">
<header/>
<body>
<trans-unit id="search">
<target>Suche</target>
</trans-unit>
</body>
</file>
</xliff>
This is the right way I guess. But the output is only "Search" and not "Suche". Did I miss something?
For the translated one you have to specify source AND target language:
take a look at:
http://docs.typo3.org/typo3cms/CoreApiReference/6.2/Internationalization/Introduction/Index.html
hope that works for you...
You can use the translate viewhelper inside of your fluidtemplate.
See: https://fedext.net/viewhelpers/fluid/TranslateViewHelper.html

Packaging SQL files only using Nuget.exe

Is there a way to package a folder of only .SQL files instead of having to add them to a project using Nuget.exe?
I know you can specify folders inside the nuspec, but what is the process of doing so? I've only been able to make packages from using .net project/applications.
For example, If I create a nuspec inside called Database.nuspec
F:\folder\trunk\Source\Database.nuspec
inside the folder
F:\folder\trunk\Source\Database
and I want to package up my patch scripts folder
F:\folder\trunk\Source\Database\Patch Scripts
and inside that folder I had
F:\folder\trunk\Source\Database\Patch Scripts\2.0
F:\folder\trunk\Source\Database\Patch Scripts\2.1
F:\folder\trunk\Source\Database\Patch Scripts\2.2
Would I need to include these folders inside of my nuspec or is nuget.exe smart enough to package them up for me?
E.G
Update:
Solution 1:
would be to include each folder to the nuspec
<files>
<file src="F:\folder\trunk\Source\Database\*.sql" target="Database" />
<file src="F:\folder\trunk\Source\Database\Patch Scripts\*.sql" target="Database\Patch Scripts\" />
<file src="F:\folder\trunk\Source\Database\Patch Scripts\2.0\*.sql" target="Database\Patch Scripts\2.0" />
</files>
But I have a lot of patch files and it will be quite tedious to write out about 40 into a nuspec, I will update if I find a work around.
Solution 2:
ufuk-haciogullari suggested using
*\*.sql
as the source since they are one level down, and this does what I want, but I need to keep the file structure intact, If i were to just write
<files>
<file src="F:\folder\trunk\Source\Database\*.sql" target="Database" />
<file src="F:\folder\trunk\Source\Database\Patch Scripts\*\*.sql" target="Database\Patch Scripts" />
</files>
it will store all the returns into the target Database\Patch Scripts\ and this isn't the structure I want.
Update:
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>database</id>
<version>1.0.6</version>
<authors>me</authors>
<description>Description</description>
</metadata>
<files>
<file src="F:\folder\trunk\Source\Database\*.sql" target="Database\" />
<file src="F:\folder\trunk\Source\Database\Patch Scripts\**\*.sql" target="Database\Patch Scripts" />
</files>
This packages my solution and stores the files as they were in the previous format.
nuget.exe pack "F:\folder\trunk\Source\Database\database.nuspec" -OutputDirectory F:\NuGetStore
UPDATE:
Coming back to this, if you leave the target blank in it will re-create the same folder structure that is already in place, so you don't need to create directories.
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>database</id>
<version>1.0.6</version>
<authors>me</authors>
<description>Description</description>
</metadata>
<files>
<file src="F:\folder\trunk\Source\Database\*.sql" target="" />
<file src="F:\folder\trunk\Source\Database\Patch Scripts\**\*.sql" target="" />
</files>
This packages my solution and stores the files.
nuget.exe pack "F:\folder\trunk\Source\Database\database.nuspec" -OutputDirectory F:\NuGetStore
You can create a nuspec file and state those files explicitly.
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MyPackage</id>
<version>1.0.0</version>
<authors>me</authors>
<description>Description</description>
</metadata>
<files>
<file src="*.sql" target="Content\SqlFiles" />
</files>
</package>
Then run pack command on the nuspec file.
NuGet.exe pack MyPackage.nuspec