/** * Get the resource name for a grouped resource. * * @param string $prefix * @param string $resource * @param string $method * @return string */ protected function getGroupResourceName($prefix, $resource, $method) { $group = trim(str_replace('/', '.', $this->router->getLastGroupPrefix()), '.'); if (!empty($group) && $group !== localization()->getCurrentLocale()) { return trim("{$prefix}{$group}.{$resource}.{$method}", '.'); } return trim("{$prefix}{$resource}.{$method}", '.'); }
/** * Get redirection. * * @param string $locale * * @return string|false */ protected function getRedirectionUrl($locale) { if ($this->getSupportedLocales()->has($locale)) { return $this->isDefaultLocaleHidden($locale) ? localization()->getNonLocalizedURL() : false; } // If the current url does not contain any locale // The system redirect the user to the very same url "localized" we use the current locale to redirect him if ($this->getCurrentLocale() !== $this->getDefaultLocale() || !$this->hideDefaultLocaleInURL()) { return localization()->getLocalizedURL(); } return false; }
/** * Get redirection. * * @param \Illuminate\Http\Request $request * * @return string|false */ protected function getRedirectionUrl(Request $request) { $locale = $request->segment(1, null); if ($this->getSupportedLocales()->has($locale)) { return $this->isDefaultLocaleHidden($locale) ? localization()->getNonLocalizedURL() : false; } // If the current url does not contain any locale // The system redirect the user to the very same url "localized" we use the current locale to redirect him if ($this->getCurrentLocale() !== $this->getDefaultLocale() || !$this->hideDefaultLocaleInURL()) { return localization()->getLocalizedURL(session('locale'), $request->fullUrl()); } return false; }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle(Request $request, Closure $next) { $segment = $request->segment(1, null); $locale = $request->cookie('locale', null); if (localization()->isLocaleSupported($segment)) { return $next($request)->withCookie(cookie()->forever('locale', $segment)); } if ($locale !== null && !$this->isDefaultLocaleHidden($locale)) { if (!is_null($redirect = $this->getLocalizedRedirect($locale))) { return $redirect->withCookie(cookie()->forever('locale', $segment)); } } return $next($request); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle(Request $request, Closure $next) { $locale = $request->segment(1, null); if (localization()->isLocaleSupported($locale)) { cookie('locale', $locale); return $next($request); } $locale = $request->cookie('locale', null); if (is_string($locale) && !$this->isDefaultLocaleHidden($locale)) { session()->reflash(); $redirect = $this->getLocalizedRedirect($locale); if (!is_null($redirect)) { return $redirect; } } return $next($request); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle(Request $request, Closure $next) { $segment = $request->segment(1, null); $locale = session('locale', null); if (localization()->isLocaleSupported($segment)) { session()->put(['locale' => $segment]); return $next($request); } elseif (localization()->isDefaultLocaleHiddenInUrl()) { $locale = localization()->getDefaultLocale(); session()->put(compact('locale')); } if (is_string($locale) && !$this->isDefaultLocaleHidden($locale)) { session()->reflash(); $redirect = $this->getLocalizedRedirect($locale); if (!is_null($redirect)) { return $redirect; } } return $next($request); }
/** * Register a new translated any route with the router. * * @param string $trans * @param \Closure|array|string $action * * @return \Illuminate\Routing\Route */ public function transAny($trans, $action) { $uri = localization()->transRoute($trans); return $this->any($uri, $action); }
/** * Get the redirection response. * * @param string $locale * * @return RedirectResponse|null */ protected function getLocalizedRedirect($locale) { $localizedUrl = localization()->getLocalizedURL($locale); if (!is_string($localizedUrl)) { return null; } return $this->makeRedirectResponse($localizedUrl); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle(Request $request, Closure $next) { localization()->setRouteNameFromRequest($request); return $next($request); }
</div> <div class="col-lg-3 col-sm-4 col-xs-12"> <div class="sectionHeader hidden-xs"> <em><?php echo localization("Share", "Partagez"); ?> </em> </div> </div> <div class="col-lg-4 col-sm-8 col-xs-12" data-animation="fadeInDown"> <div class="textContent"> <div class="innerContainer"> <p class="sectionText"> <?php echo localization("Are you worried about access to recreational or health facilities at your destination? Are you thinkining about what activities your children can do once you leave for your vacations? Why not asking another family? Our platform will connect you with families at your destination in order to find an answer for your concerns. Connect with another family and use their personal experience.", "Grâce à notre site vous allez accéder à des services proposés par d’autres familles qui seront ravis de vous aider. C’est aussi l'occasion de faire de nouvelles rencontres inoubliables et de découvrir votre destination de manière totalement différente."); ?> </p> </div> </div> </div> </div> </div> </div> </div> <?php include 'login-modal.php.inc'; ?>
</h4> <div class="filters-wrapper"> <div class="checkMark"> <label for="french" class="filter"></label> <input type="checkbox" class="ui_checkbox" name="french" value="french"> <span class="ui_checkbox_target clr"></span> <span> <?php echo localization("French", "Français"); ?> </span> </div> <br /> <div class="checkMark"> <label for="english" class="filter"></label> <input type="checkbox" class="ui_checkbox" name="english" value="english"> <span class="ui_checkbox_target clr"></span> <span> <?php echo localization("English", "Anglais"); ?> </span> </div> <br /> <!--<div class="checkMark"> <label for="spanish" class="filter"></label> <input type="checkbox" class="ui_checkbox" name="spanish" value="spanish"> <span class="ui_checkbox_target clr"></span> <span> Spanish </span> </div> <br />--> </div> </div> <hr class="divider"> </div> </div>
echo localization("Price per day", "Prix par jour"); ?> " type="text" value="<?php echo $service['price_per_day']; ?> " class="form-control" style="width:70px" data-toggle="tooltip" data-placement="top" data-original-title="Please enter a valid price"> <span class="input-group-addon">€/day</span> </div> </label> <label> <input type="submit" value="Save" class="form-control" > </label> </div> <div class="form-inline"> <textarea class="form-control" rows="3" style="width:700px" name="desc" placeholder="<?php echo localization("Add a brief description about the service you are providing", "Add a brief description about the service you are providing"); ?> "><?php echo $service['service_desc']; ?> </textarea> <label> <a class="btn btn-default" href="delservice.php?ctid=<?php echo $service['ctid']; ?> ">Delete</a> </label> </div> </form>
/** * Returns an URL adapted to locale * * @param string $locale * @param string $url * @param array $attributes * * @return string */ function localize_url($locale = null, $url = null, $attributes = []) { return localization()->getLocalizedURL($locale, $url, $attributes); }
"> <label for="comments"><?php echo localization("Additional comments", "Commentaires"); ?> :</label> <textarea id="comments" name="comments" rows="3" placeholder="<?php echo localization("Please enter your comments here!", "Entrez vos commentaires ici !"); ?> "></textarea> </p> <span class="share-error"></span> </div> <div class="modal-footer"> <input class="btn btn-primary" name="commit" type="submit" value="<?php echo localization("Book", "Réserver"); ?> "> </div> </div> </form> </div> </div> </div> <?php include 'login-modal.php.inc'; ?>