How to install sylius translation - symfony

I cloned sylius/sylius. Everything runs fine so far.
But I have no clue, nor found in the docs, how i can install a translation for sylius.
At the moment there are only the keys visible in by Admin-Backend.
Any hint?

There are few ways how to solve your issue:
the right way
First all translations (except english) are done on crowdin
https://crowdin.com/project/sylius
Look there if your language is missing some translations and translate the missing strings.
These translated strings are merged to master every week, as of yesterday.
So when they will be merged just update your sylius installation with 'composer update'
the possible but not so great way
Another option, if you don't / can't wait. Copy the translation files inside your app/Resources//translations folder.
Add missing translations directly in the yaml files.
The keys for translation strings you can see in the debug panel, or by listing them with console command ...
These translation files are following standard way how symfony translates, strings, so for more information how to override translation you can look here
http://symfony.com/doc/current/book/translation.html

Please see answers and comments on https://stackoverflow.com/a/21989633/487878 . It will also lead you to https://github.com/Sylius/Sylius/issues/133, https://github.com/Sylius/Sylius/issues/794, https://github.com/Sylius/Sylius/issues/1080 . As I have not worked on Sylius translation I am not sure, but my belief is that you can copy the yml and keep on the app/Resources/translations as symfony is the underlying system. Good luck with your research.

Related

Bundles don't automatically create their .yaml files

I've been trying to create and setup a project under Symfony 4.4 for a few hours now but it seems like i'm getting a problem when i'm downloading bundles or installing things (For example, Doctrine or FOSrest).
Multiple times in tutorials I've seen that all the people seemed to have files such as "Doctrine.yaml" which are supposed to be stored in config/packages. And it seems like these configuration files are automatically created upon downloading the files associated to it.
But in my case there's simply... nothing, I have to create manually all the files, and i'm not sure if that's normal and if not, how can I resolve this problem ?
And it seems like these configuration files are automatically created upon downloading the files associated to it.
You're looking for the Symfony recipes which allow composer packages via Symfony/flex to automate common tasks when you install a new bundle.
A more detailed explanation regarding how does flex work you'll find in the official documentation here when it was first introduced in Symfony 3.4, but note that is not maintained anymore for this version.
I corrected it. I simply was being too dumb. When I created the git repository, I did the installation wrong and I didn't immediatly notice that I was downloading things into the wrong repository.
Thanks for all the answers!

How can I find unused libraries in a Symfony project with PhpStorm?

I try to find and also to delete all the unused libraries in a project. For example I have a folder lib/ with lot of other folder which are the famous libraries. I want to know how I can identify which libraries are not used.
I asked the same question here but the only response I received suggests to me to check each file one by one ...
Can you help me?
I don't think that is possible, as some libraries may be lazy loaded depending on some internal state of your application.
So even if you could somehow find all strong typed references inspecting the code, you have no way of finding out if a library is loaded via magic methods, custom class loaders, dynamically generated include or require statement, eval-ed code and so on.
Without having tests with 95%+ coverage for your non-library code, it is very risky to remove anything from your lib folder. You code may appear to run fine, but still fail in some edge cases.
There's an open source project that can help you to do that:
https://github.com/composer-unused/composer-unused
Installation
composer require composer-unused/composer-unused-plugin
Usage
composer unused
And if you want to use it inside phpstorm, you can look at their composer documentation: https://www.jetbrains.com/help/phpstorm/using-the-composer-dependency-manager.html#create-and-run-composer-scripts

Export a jar file from Eclipse or Command Line

This is my first post ever but I intend to use this more often in the future so please be critical if I do something wrong.
I have done research on the topic and have already attempted everything from using the command line to Eclipse's File>export>jar and choosing the appropriate options.
Basically I have attempted everything suggested in the following two links:
Java: export to an .jar file in eclipse
http://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html
The results of my efforts are:
1) a jar file is created
2) when I try to run it the error is "Failed to load Main-Class manifest attribute from test.jar"
I assure you that I have indeed created a "manifest.txt" file in my project that consists of
"Main-Class: Login
"
I even include a newline because I hear that is necessary in some instances.
Does anyone know what I could be missing? Or better yet can anyone please provide an extremely detailed explanation of how to create a jar. This could be either from command line or eclipse.
My current project is setup where I have three java files in my workspace: Login, NewFrame, and NewUser. Login has the main method which will eventually call the other files. These three files are in the default package. The projects name is JavaVersion.
Thanks.
Thank you Antimony for your interest and help. After more tinkering I was able to figure it out for myself. Turns out I was never correctly defining the entry point. For anyone looking to export a jar in Eclipse I would also like to recommend this link.
How do you build a JAR in eclipse with a custom manifest file?

I need a sensible and simple Plone project directory structure

I've been asked to build a website with Plone. I would also like to use git version control for this project. Ideally, I would have all the work I do stored in one directory -- my project directory -- which will also make version control simple. Can anyone point me to a resource that explains how to do this?
We keep our company project skeleton at https://github.com/niteoweb/niteoweb.skel.plone.
It has some of our internal specifics, but should be usable. At least as a point of reference.

Include another MSI file in my setup project

I'm trying to make a setup program for an ASP.NET web site. I need to make sure the target machine has sqlxml installed.
I must verify the target machine has the software installed, and if not, launch a .msi file either before or after the main installation.
I'm a complete newbie with setup projects, so maybe this is obvious, but after several hours browsing the web I haven't found a satisfactory solution. I've been reading about WiX, etc. but I'm looking (if possible) for a simple solution.
Thank you both!
I understand an installer can't run another one. I was thinking in a functionality similar to Prerequisites (in project properties). There I can check a component and it will be automatically installed if it isn't. I don't need to do anything else. But, the most important thing for me is that the installation won't run if it's not needed.
I also tried the .msm solution, but I couldn't find any. Maybe I can make one myself? I haven't tried it yet though.
Unfortunately, you can't run one installer from another, since only one can be running at a time. You need to chain them together and run one after the other. Google "msi chaining". This is often the reason why products like Visual Studio use an external setup.exe which then runs the installers one after the other.
Looks like you need to 'chain' the installs http://objectmix.com/xml-soap/84668-installing-sqlxml-net-app.html
You can get the redist here http://www.microsoft.com/downloads/details.aspx?FamilyID=51D4A154-8E23-47D2-A033-764259CFB53B&displaylang=en
CAn you add this as a pre-req for your install?
What are you using to build the create the install?
Edit:
I had a look to see how you can check of the SQLXML is installed and come across this:
http://www.tech-archive.net/Archive/SQL-Server/microsoft.public.sqlserver.xml/2005-04/msg00110.html
The system I am on just now has the following key HKEY_CLASSES_ROOT \ SQLXMLX (note the X at the end), so you might need to do a bit more investigation in to what the actual key is.
I'm not familer with Visual Studio install authoring but if you can add an entry to the AppSearch and RegLocator tables you should be able to check for the existance of the registry key when the install starts. See here
http://msdn.microsoft.com/en-us/library/aa371564(VS.85).aspx
The Reglocator table gives you the option to set a property with a value from the registry if found. You can then use this in the condition on a custom action.
A lot to put together, but I hope it move you in the right direction.
Brent's answer is correct. I would just add that, sometimes, you can find a "merge module" for the bits you depend on. That's a .msm file. You can certainly include 1 or more of those in your .msi file. I have no idea whether a merge module is available for SQLXML. Sorry.

Resources