Giter Club home page Giter Club logo

laravel-language's Introduction

Akaunting™

Release Downloads Translations Tests

Online accounting software designed for small businesses and freelancers. Akaunting is built with modern technologies such as Laravel, VueJS, Tailwind, RESTful API etc. Thanks to its modular structure, Akaunting provides an awesome App Store for users and developers.

Requirements

  • PHP 8.1 or higher
  • Database (e.g.: MySQL, PostgreSQL, SQLite)
  • Web Server (eg: Apache, Nginx, IIS)
  • Other libraries

Framework

Akaunting uses Laravel, the best existing PHP framework, as the foundation framework and Module package for Apps.

Installation

  • Install Composer and Npm
  • Clone the repository: git clone https://github.com/akaunting/akaunting.git
  • Install dependencies: composer install ; npm install ; npm run dev
  • Install Akaunting:
php artisan install --db-name="akaunting" --db-username="root" --db-password="pass" --admin-email="[email protected]" --admin-password="123456"
  • Create sample data (optional): php artisan sample-data:seed

Contributing

Please, be very clear on your commit messages and Pull Requests, empty Pull Request messages may be rejected without reason.

When contributing code to Akaunting, you must follow the PSR coding standards. The golden rule is: Imitate the existing Akaunting code.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Translation

If you'd like to contribute translations, please check out our Crowdin project.

Changelog

Please see Releases for more information about what has changed recently.

Security

Please review our security policy on how to report security vulnerabilities.

Credits

License

Akaunting is released under the BSL license.

laravel-language's People

Contributors

blackikeeagle avatar cuneytsenturk avatar dasturchiuz avatar denisdulici avatar drsdre avatar enessacid-buker avatar lsmith77 avatar muhammadn avatar vibrantbits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-language's Issues

change controller and middleware dir

I have made some changes in your controllers and your middleware so i have copied them to my own controller and middleware folder and then via config/language.php i want to redirect to the copied middleware and controller but it seem not to find my copied middleware/controller. Is this even possible if so how? i know this might be an question more than a issue but iam new to programming an would appreciate some help. I have tried using the base_path('app/http/controll...) function but i get an error stating the file could not be found

Issue with custom namespace

When someone doesn't use App as namespace, the vendor/akaunting/language/src/Controllers/Language.php brings a fatal error saying "Class 'App\Http\Controllers\Controller' not found"

Is there any way to override it, without having to delete the file from vendor manually?

Flags not visible after instalation

Hello,

Nice package! Very useful and simple to use. The issue I face is the following:

Fresh install of the package in laravel 9. Followed installation procedure. Published config and ran migration. My routes are inside teh translation route group. The following code:

<div class="bg-red-600">{{ language()->flags()}}</div>
using this config:
'allowed' => ['en', 'es'],

Renders this:
imagen

I have some things in mind:

  • Is it correct for spanish not to have code?
  • Is the line jump before the first appearance of (US) intended
  • Should the flags be visible of should I do something to make it happen?

Possibly related to #34

Many thanks

Personalized middleware language routes...

Hello!

It will be cool to have a config parameter to define which middlewares should have the package routes. For example:

config/language.php

    /*
    |--------------------------------------------------------------------------
    | Enable All Language Routes
    |--------------------------------------------------------------------------
    |
    | This option enable language route.
    |
    */
    'route'         => true,


    /**
     * New option for routes_middleware
     */
    'routes_middlewares' => ['web',  'language',  'ANOTHER_COOL_MIDDLEWARE'],

akaunting/language/src/Routes/web.php

Route::group([
    // reading from config file the 
    'middleware' => config('language.routes_middlewares', ['web', 'language']),
    'as'         => 'language::',
    'prefix'     => config('language.prefix'),
], function () {
    $controller = config('language.controller');

Default fallback language?

Is it possible to set a default fallback language?

My browser language is set to english, but my website only allows languages "de", "fr" and "it". Currently this will set "undefined" as language.

In the config have set 'auto' => true

Language switch url gives Redirector error in content

Since using Laravel 5.8 I'm hitting on an error when I'm switching language using the language()->back($code) function. This error blocks in local (debug) mode, in production the route is followed.

ErrorException: Object of class Illuminate\Routing\Redirector could not be converted to string in file /project/vendor/symfony/http-foundation/Response.php on line 404

My language.php configuration:
'route' => true,
'home' => true,
'url' => false,
'carbon' => true,
'date' => false,
'auto' => true,
'prefix' => 'languages',
'middleware' => 'Akaunting\Language\Middleware\SetLocale',
'mode' => ['code' => 'short', 'name' => 'native'],

Flag images aren't published to the public folder on installation

I just installed the package and had the issue that the default flag views tried to access assets in the vendor folder (which of course won't work). The code needs to publish the flag icons in the public folder on installation, just as it does with the views.

Prefix url not found

Hello. I have enabled property url in config. When I go to site: site.com/en/ or site.com/de/ I get 404. Why? And when I change language, I get wrong path like this: site.com/back/ite.com

My code of language switcher:

@foreach (language()->allowed() as $code => $name)
    <a href="{{ language()->back($code) }}">{{ $name }}</a>
@endforeach

Auth save issue

Call to a member function save() on null

if (Auth::check()) {
Auth::user()->setAttribute('locale', $locale)->save();
} else {
$request->session()->put('locale', $locale);
}

The setAttribute is throwing an issue, other than that language switcher works when browsing as guest

please help :c

Pdf generation EURO problem

When generate pdf invoice euro symbol is shown as empty square:

image

Version 1.2.16 Powered By Akaunting: Free Accounting Software

Cant change language for logged in user (voyager)

if i change language for a logged in user, i got the error
Call to a member function save() on null on akaunting\language\src\Controllers\Language.php:32

Im using Laravel version 7.11.0
PHP version 7.4.0
akaunting/language version 1.0.16
tcg/voyager version 1.4

I think it's related to voyager.
i fixed it by changing Auth::user()->setAttribute('locale', $locale)->save(); to
$user = User::find(Auth::user()->id); $user->locale = $locale; $user->save();

Problem with Facebook link thumbnail

Hello, thanks for this nice script. I had a problem with facebook links where it would give an error message because $code was empty for some reason. This is what I did to fix it (src/Language.php):
public static function back($code) { if (!$code) return route('language::back', ['locale' => config('language.allowed')[0]]); return route('language::back', ['locale' => $code]); }

wrong path in /back redirect

@foreach (language()->allowed() as $code => $name)
    <a href="{{ language()->back($code) }}">{{ $name }}</a>
@endforeach

If you click on the link with /en/path to another locale (eg. /jp/home) it will redirected to /en/jp/home

seems not compatible with laravel-7

seems not compatible with laravel-7

Problem 1
- Conclusion: don't install akaunting/language 1.0.13
- Conclusion: don't install akaunting/language 1.0.12
- Conclusion: don't install akaunting/language 1.0.11
- Conclusion: don't install akaunting/language 1.0.10
- Conclusion: don't install akaunting/language 1.0.9
- Conclusion: don't install akaunting/language 1.0.8
- Conclusion: don't install akaunting/language 1.0.7
- Conclusion: don't install akaunting/language 1.0.6
- Conclusion: don't install akaunting/language 1.0.5
- Conclusion: don't install akaunting/language 1.0.4
- Conclusion: don't install akaunting/language 1.0.3
- Conclusion: don't install akaunting/language 1.0.2
- Conclusion: don't install akaunting/language 1.0.1
- Conclusion: remove laravel/framework v7.0.7
- Installation request for akaunting/language ^1.0 -> satisfiable by akaunting/language[1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9].
- Conclusion: don't install laravel/framework v7.0.7

why rely on session previousUrl and not on referrer ?

\Akaunting\Language\Controllers\Language::back() uses $session->previousUrl() and not $request->server->get('HTTP_REFERER') to determine what URL to redirect back to.

I have a single app with a shared cookie on two domains and the session approach is causing issues and the referrer approach seems more obvious and straightforward to me. Is there something I am overlooking? Would you accept a PR that at least allows the user to switch which behavior they prefer?

Stay Language

If I want to stay the language change from the login to the session started and it is kept recurrently despite disconnecting me from the system, as could be done for example I was modifying middleware but I boot in the select a language like unknow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.